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

Input: stmpe-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-12-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
00e0df61 dc20ae18

+2 -4
+2 -4
drivers/input/keyboard/stmpe-keypad.c
··· 404 404 return 0; 405 405 } 406 406 407 - static int stmpe_keypad_remove(struct platform_device *pdev) 407 + static void stmpe_keypad_remove(struct platform_device *pdev) 408 408 { 409 409 struct stmpe_keypad *keypad = platform_get_drvdata(pdev); 410 410 411 411 stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD); 412 - 413 - return 0; 414 412 } 415 413 416 414 static struct platform_driver stmpe_keypad_driver = { 417 415 .driver.name = "stmpe-keypad", 418 416 .driver.owner = THIS_MODULE, 419 417 .probe = stmpe_keypad_probe, 420 - .remove = stmpe_keypad_remove, 418 + .remove_new = stmpe_keypad_remove, 421 419 }; 422 420 module_platform_driver(stmpe_keypad_driver); 423 421