diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2019-04-23 15:50:16 +0800 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-29 15:53:43 +0200 |
commit | 527bd754d1ffc4bbd89a33c643e74c53d713eb4e (patch) | |
tree | f2adaae984ff1e29070cb40a8804ea387df3fd7e /drivers/rtc/rtc-wm8350.c | |
parent | c8889bb6e62f17822419bd253a08c96aee963722 (diff) |
rtc: Use dev_get_drvdata()
Using dev_get_drvdata directly.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-wm8350.c')
-rw-r--r-- | drivers/rtc/rtc-wm8350.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c index 483c7993516b..f54fa12c4b4b 100644 --- a/drivers/rtc/rtc-wm8350.c +++ b/drivers/rtc/rtc-wm8350.c @@ -340,8 +340,7 @@ static const struct rtc_class_ops wm8350_rtc_ops = { #ifdef CONFIG_PM_SLEEP static int wm8350_rtc_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct wm8350 *wm8350 = dev_get_drvdata(&pdev->dev); + struct wm8350 *wm8350 = dev_get_drvdata(dev); int ret = 0; u16 reg; @@ -351,8 +350,7 @@ static int wm8350_rtc_suspend(struct device *dev) reg & WM8350_RTC_ALMSTS) { ret = wm8350_rtc_stop_alarm(wm8350); if (ret != 0) - dev_err(&pdev->dev, "Failed to stop RTC alarm: %d\n", - ret); + dev_err(dev, "Failed to stop RTC alarm: %d\n", ret); } return ret; @@ -360,15 +358,13 @@ static int wm8350_rtc_suspend(struct device *dev) static int wm8350_rtc_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct wm8350 *wm8350 = dev_get_drvdata(&pdev->dev); + struct wm8350 *wm8350 = dev_get_drvdata(dev); int ret; if (wm8350->rtc.alarm_enabled) { ret = wm8350_rtc_start_alarm(wm8350); if (ret != 0) - dev_err(&pdev->dev, - "Failed to restart RTC alarm: %d\n", ret); + dev_err(dev, "Failed to restart RTC alarm: %d\n", ret); } return 0; |