summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-bq4802.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-04-19 16:06:14 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-03 22:08:00 +0200
commit85368bb9de6366654f442e26fdd571981f205291 (patch)
tree807385ec3a590efc12b24fe22b3ee7f8fd204e0f /drivers/rtc/rtc-bq4802.c
parentrtc: cmos: introduce quirks to enable use_acpi_alarm mode (diff)
downloadlinux-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-bq4802.c')
-rw-r--r--drivers/rtc/rtc-bq4802.c6
1 files changed, 2 insertions, 4 deletions
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;