diff options
author | Guenter Roeck <linux@roeck-us.net> | 2019-04-08 21:38:38 +0200 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2019-05-05 21:02:19 +0200 |
commit | d6ab05106a70c584318479ec766f6f82c63e0541 (patch) | |
tree | 0f774f2512d2278aae2a75481784ae5a5583cb77 /drivers/watchdog/ep93xx_wdt.c | |
parent | watchdog: davinci_wdt: Convert to use device managed functions and other impr... (diff) | |
download | linux-d6ab05106a70c584318479ec766f6f82c63e0541.tar.xz linux-d6ab05106a70c584318479ec766f6f82c63e0541.zip |
watchdog: ep93xx_wdt: Use 'dev' instead of dereferencing it repeatedly
Introduce local variable 'struct device *dev' and use it instead of
dereferencing it repeatedly.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/ep93xx_wdt.c')
-rw-r--r-- | drivers/watchdog/ep93xx_wdt.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index 1e721c2f9eac..38e26f160b9a 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c @@ -89,12 +89,13 @@ static const struct watchdog_ops ep93xx_wdt_ops = { static int ep93xx_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct ep93xx_wdt_priv *priv; struct watchdog_device *wdd; unsigned long val; int ret; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -110,21 +111,21 @@ static int ep93xx_wdt_probe(struct platform_device *pdev) wdd->ops = &ep93xx_wdt_ops; wdd->min_timeout = 1; wdd->max_hw_heartbeat_ms = 200; - wdd->parent = &pdev->dev; + wdd->parent = dev; watchdog_set_nowayout(wdd, nowayout); wdd->timeout = WDT_TIMEOUT; - watchdog_init_timeout(wdd, timeout, &pdev->dev); + watchdog_init_timeout(wdd, timeout, dev); watchdog_set_drvdata(wdd, priv); - ret = devm_watchdog_register_device(&pdev->dev, wdd); + ret = devm_watchdog_register_device(dev, wdd); if (ret) return ret; - dev_info(&pdev->dev, "EP93XX watchdog driver %s\n", - (val & 0x08) ? " (nCS1 disable detected)" : ""); + dev_info(dev, "EP93XX watchdog driver %s\n", + (val & 0x08) ? " (nCS1 disable detected)" : ""); return 0; } |