From: Geliang Tang Date: Sun, 27 Dec 2015 13:15:47 +0000 (+0800) Subject: watchdog: cadence_wdt: use to_platform_device() X-Git-Tag: v4.14-rc1~3998^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62e21f5d90f162208e43b8a248b01e1a4a24ecbd;p=platform%2Fkernel%2Flinux-rpi.git watchdog: cadence_wdt: use to_platform_device() Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c index abf64eb..4dda902 100644 --- a/drivers/watchdog/cadence_wdt.c +++ b/drivers/watchdog/cadence_wdt.c @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev) */ static int __maybe_unused cdns_wdt_suspend(struct device *dev) { - struct platform_device *pdev = container_of(dev, - struct platform_device, dev); + struct platform_device *pdev = to_platform_device(dev); struct cdns_wdt *wdt = platform_get_drvdata(pdev); cdns_wdt_stop(&wdt->cdns_wdt_device); @@ -440,8 +439,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 = container_of(dev, - struct platform_device, dev); + struct platform_device *pdev = to_platform_device(dev); struct cdns_wdt *wdt = platform_get_drvdata(pdev); ret = clk_prepare_enable(wdt->clk);