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

Input: adp5520-keys - 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-2-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
18965fcf 305dd764

+2 -4
+2 -4
drivers/input/keyboard/adp5520-keys.c
··· 168 168 return 0; 169 169 } 170 170 171 - static int adp5520_keys_remove(struct platform_device *pdev) 171 + static void adp5520_keys_remove(struct platform_device *pdev) 172 172 { 173 173 struct adp5520_keys *dev = platform_get_drvdata(pdev); 174 174 175 175 adp5520_unregister_notifier(dev->master, &dev->notifier, 176 176 ADP5520_KP_IEN | ADP5520_KR_IEN); 177 - 178 - return 0; 179 177 } 180 178 181 179 static struct platform_driver adp5520_keys_driver = { ··· 181 183 .name = "adp5520-keys", 182 184 }, 183 185 .probe = adp5520_keys_probe, 184 - .remove = adp5520_keys_remove, 186 + .remove_new = adp5520_keys_remove, 185 187 }; 186 188 module_platform_driver(adp5520_keys_driver); 187 189