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

Input: da9052_tsi - 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-45-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
b4365149 8df82842

+2 -4
+2 -4
drivers/input/touchscreen/da9052_tsi.c
··· 311 311 return error; 312 312 } 313 313 314 - static int da9052_ts_remove(struct platform_device *pdev) 314 + static void da9052_ts_remove(struct platform_device *pdev) 315 315 { 316 316 struct da9052_tsi *tsi = platform_get_drvdata(pdev); 317 317 ··· 322 322 323 323 input_unregister_device(tsi->dev); 324 324 kfree(tsi); 325 - 326 - return 0; 327 325 } 328 326 329 327 static struct platform_driver da9052_tsi_driver = { 330 328 .probe = da9052_ts_probe, 331 - .remove = da9052_ts_remove, 329 + .remove_new = da9052_ts_remove, 332 330 .driver = { 333 331 .name = "da9052-tsi", 334 332 },