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: rti: 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-28-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
4ead88bf 3628149f

+2 -4
+2 -4
drivers/watchdog/rti_wdt.c
··· 304 304 return ret; 305 305 } 306 306 307 - static int rti_wdt_remove(struct platform_device *pdev) 307 + static void rti_wdt_remove(struct platform_device *pdev) 308 308 { 309 309 struct rti_wdt_device *wdt = platform_get_drvdata(pdev); 310 310 311 311 watchdog_unregister_device(&wdt->wdd); 312 312 pm_runtime_put(&pdev->dev); 313 313 pm_runtime_disable(&pdev->dev); 314 - 315 - return 0; 316 314 } 317 315 318 316 static const struct of_device_id rti_wdt_of_match[] = { ··· 325 327 .of_match_table = rti_wdt_of_match, 326 328 }, 327 329 .probe = rti_wdt_probe, 328 - .remove = rti_wdt_remove, 330 + .remove_new = rti_wdt_remove, 329 331 }; 330 332 331 333 module_platform_driver(rti_wdt_driver);