diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-04-19 16:06:14 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-03 22:08:00 +0200 |
commit | 85368bb9de6366654f442e26fdd571981f205291 (patch) | |
tree | 807385ec3a590efc12b24fe22b3ee7f8fd204e0f /drivers/rtc/rtc-ds1511.c | |
parent | rtc: cmos: introduce quirks to enable use_acpi_alarm mode (diff) | |
download | linux-85368bb9de6366654f442e26fdd571981f205291.tar.xz linux-85368bb9de6366654f442e26fdd571981f205291.zip |
rtc: simplify getting .drvdata
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Michal Simek <michal.simek@xilinx.com> (for zynqmp)
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1511.c')
-rw-r--r-- | drivers/rtc/rtc-ds1511.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index a7d5ca428d68..b8b6e51c0461 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -314,8 +314,7 @@ ds1511_rtc_update_alarm(struct rtc_plat_data *pdata) static int ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - struct platform_device *pdev = to_platform_device(dev); - struct rtc_plat_data *pdata = platform_get_drvdata(pdev); + struct rtc_plat_data *pdata = dev_get_drvdata(dev); if (pdata->irq <= 0) return -EINVAL; @@ -334,8 +333,7 @@ ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { - struct platform_device *pdev = to_platform_device(dev); - struct rtc_plat_data *pdata = platform_get_drvdata(pdev); + struct rtc_plat_data *pdata = dev_get_drvdata(dev); if (pdata->irq <= 0) return -EINVAL; @@ -373,8 +371,7 @@ ds1511_interrupt(int irq, void *dev_id) static int ds1511_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) { - struct platform_device *pdev = to_platform_device(dev); - struct rtc_plat_data *pdata = platform_get_drvdata(pdev); + struct rtc_plat_data *pdata = dev_get_drvdata(dev); if (pdata->irq <= 0) return -EINVAL; |