summaryrefslogtreecommitdiff
path: root/drivers/watchdog/cadence_wdt.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-04-19 16:06:29 +0200
committerWim Van Sebroeck <wim@linux-watchdog.org>2018-05-21 21:24:40 +0200
commit20745634c569b9948678b166f94da3041296ef52 (patch)
tree0b9b1856011df68026007ed4de6dd900edc0bc93 /drivers/watchdog/cadence_wdt.c
parent771c577c23bac90597c685971d7297ea00f99d11 (diff)
watchdog: 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> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/cadence_wdt.c')
-rw-r--r--drivers/watchdog/cadence_wdt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 3ec1f418837d..c3924356d173 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -418,8 +418,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
*/
static int __maybe_unused cdns_wdt_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct cdns_wdt *wdt = platform_get_drvdata(pdev);
+ struct cdns_wdt *wdt = dev_get_drvdata(dev);
if (watchdog_active(&wdt->cdns_wdt_device)) {
cdns_wdt_stop(&wdt->cdns_wdt_device);
@@ -438,8 +437,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
static int __maybe_unused cdns_wdt_resume(struct device *dev)
{
int ret;
- struct platform_device *pdev = to_platform_device(dev);
- struct cdns_wdt *wdt = platform_get_drvdata(pdev);
+ struct cdns_wdt *wdt = dev_get_drvdata(dev);
if (watchdog_active(&wdt->cdns_wdt_device)) {
ret = clk_prepare_enable(wdt->clk);