From 85368bb9de6366654f442e26fdd571981f205291 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 19 Apr 2018 16:06:14 +0200 Subject: 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 Acked-by: Michal Simek (for zynqmp) Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1216.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/rtc/rtc-ds1216.c') 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); -- cgit v1.2.1