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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ti_am335x_tsc - 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-51-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
d722a702 1b1904f6

+2 -3
+2 -3
drivers/input/touchscreen/ti_am335x_tsc.c
··· 491 491 return err; 492 492 } 493 493 494 - static int titsc_remove(struct platform_device *pdev) 494 + static void titsc_remove(struct platform_device *pdev) 495 495 { 496 496 struct titsc *ts_dev = platform_get_drvdata(pdev); 497 497 u32 steps; ··· 508 508 input_unregister_device(ts_dev->input); 509 509 510 510 kfree(ts_dev); 511 - return 0; 512 511 } 513 512 514 513 static int titsc_suspend(struct device *dev) ··· 551 552 552 553 static struct platform_driver ti_tsc_driver = { 553 554 .probe = titsc_probe, 554 - .remove = titsc_remove, 555 + .remove_new = titsc_remove, 555 556 .driver = { 556 557 .name = "TI-am335x-tsc", 557 558 .pm = pm_sleep_ptr(&titsc_pm_ops),