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: sun4i-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>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230920125829.1478827-50-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
1b1904f6 3401b7f5

+2 -4
+2 -4
drivers/input/touchscreen/sun4i-ts.c
··· 375 375 return 0; 376 376 } 377 377 378 - static int sun4i_ts_remove(struct platform_device *pdev) 378 + static void sun4i_ts_remove(struct platform_device *pdev) 379 379 { 380 380 struct sun4i_ts_data *ts = platform_get_drvdata(pdev); 381 381 ··· 385 385 386 386 /* Deactivate all IRQs */ 387 387 writel(0, ts->base + TP_INT_FIFOC); 388 - 389 - return 0; 390 388 } 391 389 392 390 static const struct of_device_id sun4i_ts_of_match[] = { ··· 401 403 .of_match_table = sun4i_ts_of_match, 402 404 }, 403 405 .probe = sun4i_ts_probe, 404 - .remove = sun4i_ts_remove, 406 + .remove_new = sun4i_ts_remove, 405 407 }; 406 408 407 409 module_platform_driver(sun4i_ts_driver);