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

Input: omap4-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-8-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
ec4c61a6 d93f3feb

+2 -4
+2 -4
drivers/input/keyboard/omap4-keypad.c
··· 461 461 return 0; 462 462 } 463 463 464 - static int omap4_keypad_remove(struct platform_device *pdev) 464 + static void omap4_keypad_remove(struct platform_device *pdev) 465 465 { 466 466 dev_pm_clear_wake_irq(&pdev->dev); 467 - 468 - return 0; 469 467 } 470 468 471 469 static const struct of_device_id omap_keypad_dt_match[] = { ··· 474 476 475 477 static struct platform_driver omap4_keypad_driver = { 476 478 .probe = omap4_keypad_probe, 477 - .remove = omap4_keypad_remove, 479 + .remove_new = omap4_keypad_remove, 478 480 .driver = { 479 481 .name = "omap4-keypad", 480 482 .of_match_table = omap_keypad_dt_match,