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

Input: ep93xx_keypad - 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-4-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
d9ee4119 63ef64cb

+2 -4
+2 -4
drivers/input/keyboard/ep93xx_keypad.c
··· 308 308 return 0; 309 309 } 310 310 311 - static int ep93xx_keypad_remove(struct platform_device *pdev) 311 + static void ep93xx_keypad_remove(struct platform_device *pdev) 312 312 { 313 313 dev_pm_clear_wake_irq(&pdev->dev); 314 - 315 - return 0; 316 314 } 317 315 318 316 static struct platform_driver ep93xx_keypad_driver = { ··· 319 321 .pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops), 320 322 }, 321 323 .probe = ep93xx_keypad_probe, 322 - .remove = ep93xx_keypad_remove, 324 + .remove_new = ep93xx_keypad_remove, 323 325 }; 324 326 module_platform_driver(ep93xx_keypad_driver); 325 327