watchdog: wm8350: Simplify using devm_watchdog_register_device()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Mar 2023 07:04:04 +0000 (08:04 +0100)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 22 Apr 2023 10:53:55 +0000 (12:53 +0200)
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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230307070404.2256308-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/wm8350_wdt.c

index 33c62d51f00ae1b6c98b7bec000dd0a8fe096833..c82c1b77d91b51e66d7840e2e808dcb040439360 100644 (file)
@@ -153,18 +153,11 @@ static int wm8350_wdt_probe(struct platform_device *pdev)
        /* Default to 4s timeout */
        wm8350_wdt_set_timeout(&wm8350_wdt, 4);
 
-       return watchdog_register_device(&wm8350_wdt);
-}
-
-static int wm8350_wdt_remove(struct platform_device *pdev)
-{
-       watchdog_unregister_device(&wm8350_wdt);
-       return 0;
+       return devm_watchdog_register_device(&pdev->dev, &wm8350_wdt);
 }
 
 static struct platform_driver wm8350_wdt_driver = {
        .probe = wm8350_wdt_probe,
-       .remove = wm8350_wdt_remove,
        .driver = {
                .name = "wm8350-wdt",
        },