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

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: sa1100: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

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/20230303213716.2123717-30-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
4dca58a8 4ead88bf

+2 -4
+2 -4
drivers/watchdog/sa1100_wdt.c
··· 229 229 return ret; 230 230 } 231 231 232 - static int sa1100dog_remove(struct platform_device *pdev) 232 + static void sa1100dog_remove(struct platform_device *pdev) 233 233 { 234 234 misc_deregister(&sa1100dog_miscdev); 235 235 clk_disable_unprepare(clk); 236 236 clk_put(clk); 237 - 238 - return 0; 239 237 } 240 238 241 239 static struct platform_driver sa1100dog_driver = { 242 240 .driver.name = "sa1100_wdt", 243 241 .probe = sa1100dog_probe, 244 - .remove = sa1100dog_remove, 242 + .remove_new = sa1100dog_remove, 245 243 }; 246 244 module_platform_driver(sa1100dog_driver); 247 245