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

Input: spear-keyboard - 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-11-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
dc20ae18 e340089d

+2 -4
+2 -4
drivers/input/keyboard/spear-keyboard.c
··· 272 272 return 0; 273 273 } 274 274 275 - static int spear_kbd_remove(struct platform_device *pdev) 275 + static void spear_kbd_remove(struct platform_device *pdev) 276 276 { 277 277 struct spear_kbd *kbd = platform_get_drvdata(pdev); 278 278 279 279 input_unregister_device(kbd->input); 280 280 clk_unprepare(kbd->clk); 281 - 282 - return 0; 283 281 } 284 282 285 283 static int spear_kbd_suspend(struct device *dev) ··· 373 375 374 376 static struct platform_driver spear_kbd_driver = { 375 377 .probe = spear_kbd_probe, 376 - .remove = spear_kbd_remove, 378 + .remove_new = spear_kbd_remove, 377 379 .driver = { 378 380 .name = "keyboard", 379 381 .pm = pm_sleep_ptr(&spear_kbd_pm_ops),