mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
watchdog: bcm47xx: Simplify using devm_watchdog_register_device()
This allows to drop the .remove() function as it only exists to unregister the watchdog device which is now done in a callback registered by devm_watchdog_register_device(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230307070404.2256308-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
74d6c68c74
commit
16da6fbb55
1 changed files with 1 additions and 11 deletions
|
@ -202,7 +202,7 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||||
watchdog_set_restart_priority(&wdt->wdd, 64);
|
watchdog_set_restart_priority(&wdt->wdd, 64);
|
||||||
watchdog_stop_on_reboot(&wdt->wdd);
|
watchdog_stop_on_reboot(&wdt->wdd);
|
||||||
|
|
||||||
ret = watchdog_register_device(&wdt->wdd);
|
ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_timer;
|
goto err_timer;
|
||||||
|
|
||||||
|
@ -218,21 +218,11 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bcm47xx_wdt_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev);
|
|
||||||
|
|
||||||
watchdog_unregister_device(&wdt->wdd);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver bcm47xx_wdt_driver = {
|
static struct platform_driver bcm47xx_wdt_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "bcm47xx-wdt",
|
.name = "bcm47xx-wdt",
|
||||||
},
|
},
|
||||||
.probe = bcm47xx_wdt_probe,
|
.probe = bcm47xx_wdt_probe,
|
||||||
.remove = bcm47xx_wdt_remove,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_platform_driver(bcm47xx_wdt_driver);
|
module_platform_driver(bcm47xx_wdt_driver);
|
||||||
|
|
Loading…
Reference in a new issue