Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Uwe Kleine-König and committed by
Wim Van Sebroeck
0e89b2c9 4095b94d

+1 -8
+1 -8
drivers/watchdog/wm8350_wdt.c
··· 153 153 /* Default to 4s timeout */ 154 154 wm8350_wdt_set_timeout(&wm8350_wdt, 4); 155 155 156 - return watchdog_register_device(&wm8350_wdt); 157 - } 158 - 159 - static int wm8350_wdt_remove(struct platform_device *pdev) 160 - { 161 - watchdog_unregister_device(&wm8350_wdt); 162 - return 0; 156 + return devm_watchdog_register_device(&pdev->dev, &wm8350_wdt); 163 157 } 164 158 165 159 static struct platform_driver wm8350_wdt_driver = { 166 160 .probe = wm8350_wdt_probe, 167 - .remove = wm8350_wdt_remove, 168 161 .driver = { 169 162 .name = "wm8350-wdt", 170 163 },