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-ds1216.c | |
parent | 36d91a4d401c284ab21213622c85cd855725f10f (diff) | |
download | linux-85368bb9de6366654f442e26fdd571981f205291.tar.bz2 |
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-ds1216.c')
-rw-r--r-- | drivers/rtc/rtc-ds1216.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c index 5f158715fb4c..50fabe1cd286 100644 --- a/drivers/rtc/rtc-ds1216.c +++ b/drivers/rtc/rtc-ds1216.c @@ -76,8 +76,7 @@ static void ds1216_switch_ds_to_clock(u8 __iomem *ioaddr) static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct ds1216_priv *priv = platform_get_drvdata(pdev); + struct ds1216_priv *priv = dev_get_drvdata(dev); struct ds1216_regs regs; ds1216_switch_ds_to_clock(priv->ioaddr); @@ -104,8 +103,7 @@ static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm) static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct ds1216_priv *priv = platform_get_drvdata(pdev); + struct ds1216_priv *priv = dev_get_drvdata(dev); struct ds1216_regs regs; ds1216_switch_ds_to_clock(priv->ioaddr); |