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

Input: samsung-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-9-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
4e268589 ec4c61a6

+2 -4
+2 -4
drivers/input/keyboard/samsung-keypad.c
··· 444 444 return error; 445 445 } 446 446 447 - static int samsung_keypad_remove(struct platform_device *pdev) 447 + static void samsung_keypad_remove(struct platform_device *pdev) 448 448 { 449 449 struct samsung_keypad *keypad = platform_get_drvdata(pdev); 450 450 ··· 453 453 input_unregister_device(keypad->input_dev); 454 454 455 455 clk_unprepare(keypad->clk); 456 - 457 - return 0; 458 456 } 459 457 460 458 static int samsung_keypad_runtime_suspend(struct device *dev) ··· 587 589 588 590 static struct platform_driver samsung_keypad_driver = { 589 591 .probe = samsung_keypad_probe, 590 - .remove = samsung_keypad_remove, 592 + .remove_new = samsung_keypad_remove, 591 593 .driver = { 592 594 .name = "samsung-keypad", 593 595 .of_match_table = of_match_ptr(samsung_keypad_dt_match),