Commit 6fef817e authored by Guenter Roeck's avatar Guenter Roeck Committed by Wim Van Sebroeck

watchdog: mt7621_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

Cc: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent fd56d6c9
...@@ -133,18 +133,19 @@ static struct watchdog_device mt7621_wdt_dev = { ...@@ -133,18 +133,19 @@ static struct watchdog_device mt7621_wdt_dev = {
static int mt7621_wdt_probe(struct platform_device *pdev) static int mt7621_wdt_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0); mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mt7621_wdt_base)) if (IS_ERR(mt7621_wdt_base))
return PTR_ERR(mt7621_wdt_base); return PTR_ERR(mt7621_wdt_base);
mt7621_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); mt7621_wdt_reset = devm_reset_control_get_exclusive(dev, NULL);
if (!IS_ERR(mt7621_wdt_reset)) if (!IS_ERR(mt7621_wdt_reset))
reset_control_deassert(mt7621_wdt_reset); reset_control_deassert(mt7621_wdt_reset);
mt7621_wdt_dev.bootstatus = mt7621_wdt_bootcause(); mt7621_wdt_dev.bootstatus = mt7621_wdt_bootcause();
watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout, watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout,
&pdev->dev); dev);
watchdog_set_nowayout(&mt7621_wdt_dev, nowayout); watchdog_set_nowayout(&mt7621_wdt_dev, nowayout);
if (mt7621_wdt_is_running(&mt7621_wdt_dev)) { if (mt7621_wdt_is_running(&mt7621_wdt_dev)) {
/* /*
...@@ -161,7 +162,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev) ...@@ -161,7 +162,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev)
set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status); set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status);
} }
return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev); return devm_watchdog_register_device(dev, &mt7621_wdt_dev);
} }
static void mt7621_wdt_shutdown(struct platform_device *pdev) static void mt7621_wdt_shutdown(struct platform_device *pdev)
......
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