Commit 20745634 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wim Van Sebroeck

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 771c577c
...@@ -418,8 +418,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev) ...@@ -418,8 +418,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
*/ */
static int __maybe_unused cdns_wdt_suspend(struct device *dev) static int __maybe_unused cdns_wdt_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct cdns_wdt *wdt = dev_get_drvdata(dev);
struct cdns_wdt *wdt = platform_get_drvdata(pdev);
if (watchdog_active(&wdt->cdns_wdt_device)) { if (watchdog_active(&wdt->cdns_wdt_device)) {
cdns_wdt_stop(&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) ...@@ -438,8 +437,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
static int __maybe_unused cdns_wdt_resume(struct device *dev) static int __maybe_unused cdns_wdt_resume(struct device *dev)
{ {
int ret; int ret;
struct platform_device *pdev = to_platform_device(dev); struct cdns_wdt *wdt = dev_get_drvdata(dev);
struct cdns_wdt *wdt = platform_get_drvdata(pdev);
if (watchdog_active(&wdt->cdns_wdt_device)) { if (watchdog_active(&wdt->cdns_wdt_device)) {
ret = clk_prepare_enable(wdt->clk); ret = clk_prepare_enable(wdt->clk);
......
...@@ -268,8 +268,7 @@ static int xwdt_remove(struct platform_device *pdev) ...@@ -268,8 +268,7 @@ static int xwdt_remove(struct platform_device *pdev)
*/ */
static int __maybe_unused xwdt_suspend(struct device *dev) static int __maybe_unused xwdt_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct xwdt_device *xdev = dev_get_drvdata(dev);
struct xwdt_device *xdev = platform_get_drvdata(pdev);
if (watchdog_active(&xdev->xilinx_wdt_wdd)) if (watchdog_active(&xdev->xilinx_wdt_wdd))
xilinx_wdt_stop(&xdev->xilinx_wdt_wdd); xilinx_wdt_stop(&xdev->xilinx_wdt_wdd);
...@@ -285,8 +284,7 @@ static int __maybe_unused xwdt_suspend(struct device *dev) ...@@ -285,8 +284,7 @@ static int __maybe_unused xwdt_suspend(struct device *dev)
*/ */
static int __maybe_unused xwdt_resume(struct device *dev) static int __maybe_unused xwdt_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct xwdt_device *xdev = dev_get_drvdata(dev);
struct xwdt_device *xdev = platform_get_drvdata(pdev);
int ret = 0; int ret = 0;
if (watchdog_active(&xdev->xilinx_wdt_wdd)) if (watchdog_active(&xdev->xilinx_wdt_wdd))
......
...@@ -447,8 +447,7 @@ static int wdat_wdt_probe(struct platform_device *pdev) ...@@ -447,8 +447,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int wdat_wdt_suspend_noirq(struct device *dev) static int wdat_wdt_suspend_noirq(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct wdat_wdt *wdat = dev_get_drvdata(dev);
struct wdat_wdt *wdat = platform_get_drvdata(pdev);
int ret; int ret;
if (!watchdog_active(&wdat->wdd)) if (!watchdog_active(&wdat->wdd))
...@@ -475,8 +474,7 @@ static int wdat_wdt_suspend_noirq(struct device *dev) ...@@ -475,8 +474,7 @@ static int wdat_wdt_suspend_noirq(struct device *dev)
static int wdat_wdt_resume_noirq(struct device *dev) static int wdat_wdt_resume_noirq(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct wdat_wdt *wdat = dev_get_drvdata(dev);
struct wdat_wdt *wdat = platform_get_drvdata(pdev);
int ret; int ret;
if (!watchdog_active(&wdat->wdd)) if (!watchdog_active(&wdat->wdd))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment