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

Input: mainstone-wm97xx - 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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>
Link: https://lore.kernel.org/r/20230920125829.1478827-46-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Uwe Kleine-König and committed by
Dmitry Torokhov
02bb3eca b4365149

+2 -4
+2 -4
drivers/input/touchscreen/mainstone-wm97xx.c
··· 252 252 return wm97xx_register_mach_ops(wm, &mainstone_mach_ops); 253 253 } 254 254 255 - static int mainstone_wm97xx_remove(struct platform_device *pdev) 255 + static void mainstone_wm97xx_remove(struct platform_device *pdev) 256 256 { 257 257 struct wm97xx *wm = platform_get_drvdata(pdev); 258 258 259 259 wm97xx_unregister_mach_ops(wm); 260 - 261 - return 0; 262 260 } 263 261 264 262 static struct platform_driver mainstone_wm97xx_driver = { 265 263 .probe = mainstone_wm97xx_probe, 266 - .remove = mainstone_wm97xx_remove, 264 + .remove_new = mainstone_wm97xx_remove, 267 265 .driver = { 268 266 .name = "wm97xx-touch", 269 267 },