Commit 16c4614f authored by Guenter Roeck's avatar Guenter Roeck Committed by Wim Van Sebroeck

watchdog: ts72xx_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-patchesSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 44affc08
...@@ -122,11 +122,12 @@ static const struct watchdog_ops ts72xx_wdt_ops = { ...@@ -122,11 +122,12 @@ static const struct watchdog_ops ts72xx_wdt_ops = {
static int ts72xx_wdt_probe(struct platform_device *pdev) static int ts72xx_wdt_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct ts72xx_wdt_priv *priv; struct ts72xx_wdt_priv *priv;
struct watchdog_device *wdd; struct watchdog_device *wdd;
int ret; int ret;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
...@@ -143,20 +144,20 @@ static int ts72xx_wdt_probe(struct platform_device *pdev) ...@@ -143,20 +144,20 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)
wdd->ops = &ts72xx_wdt_ops; wdd->ops = &ts72xx_wdt_ops;
wdd->min_timeout = 1; wdd->min_timeout = 1;
wdd->max_hw_heartbeat_ms = 8000; wdd->max_hw_heartbeat_ms = 8000;
wdd->parent = &pdev->dev; wdd->parent = dev;
watchdog_set_nowayout(wdd, nowayout); watchdog_set_nowayout(wdd, nowayout);
wdd->timeout = TS72XX_WDT_DEFAULT_TIMEOUT; wdd->timeout = TS72XX_WDT_DEFAULT_TIMEOUT;
watchdog_init_timeout(wdd, timeout, &pdev->dev); watchdog_init_timeout(wdd, timeout, dev);
watchdog_set_drvdata(wdd, priv); watchdog_set_drvdata(wdd, priv);
ret = devm_watchdog_register_device(&pdev->dev, wdd); ret = devm_watchdog_register_device(dev, wdd);
if (ret) if (ret)
return ret; return ret;
dev_info(&pdev->dev, "TS-72xx Watchdog driver\n"); dev_info(dev, "TS-72xx Watchdog driver\n");
return 0; return 0;
} }
......
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