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-bq4802.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/rtc/rtc-bq4802.c') diff --git a/drivers/rtc/rtc-bq4802.c b/drivers/rtc/rtc-bq4802.c index bd170cb3361c..d768f6747961 100644 --- a/drivers/rtc/rtc-bq4802.c +++ b/drivers/rtc/rtc-bq4802.c @@ -48,8 +48,7 @@ static void bq4802_write_mem(struct bq4802 *p, int off, u8 val) static int bq4802_read_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct bq4802 *p = platform_get_drvdata(pdev); + struct bq4802 *p = dev_get_drvdata(dev); unsigned long flags; unsigned int century; u8 val; @@ -91,8 +90,7 @@ static int bq4802_read_time(struct device *dev, struct rtc_time *tm) static int bq4802_set_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct bq4802 *p = platform_get_drvdata(pdev); + struct bq4802 *p = dev_get_drvdata(dev); u8 sec, min, hrs, day, mon, yrs, century, val; unsigned long flags; unsigned int year; -- cgit