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: stmpe-ts - 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-49-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
3401b7f5 f6f14e4a

+2 -4
+2 -4
drivers/input/touchscreen/stmpe-ts.c
··· 350 350 return 0; 351 351 } 352 352 353 - static int stmpe_ts_remove(struct platform_device *pdev) 353 + static void stmpe_ts_remove(struct platform_device *pdev) 354 354 { 355 355 struct stmpe_touch *ts = platform_get_drvdata(pdev); 356 356 357 357 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); 358 - 359 - return 0; 360 358 } 361 359 362 360 static struct platform_driver stmpe_ts_driver = { ··· 362 364 .name = STMPE_TS_NAME, 363 365 }, 364 366 .probe = stmpe_input_probe, 365 - .remove = stmpe_ts_remove, 367 + .remove_new = stmpe_ts_remove, 366 368 }; 367 369 module_platform_driver(stmpe_ts_driver); 368 370