Skip to content

Commit 1b1904f

Browse files
Uwe Kleine-Königdtor
authored andcommitted
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 <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 3401b7f commit 1b1904f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/touchscreen/sun4i-ts.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
375375
return 0;
376376
}
377377

378-
static int sun4i_ts_remove(struct platform_device *pdev)
378+
static void sun4i_ts_remove(struct platform_device *pdev)
379379
{
380380
struct sun4i_ts_data *ts = platform_get_drvdata(pdev);
381381

@@ -385,8 +385,6 @@ static int sun4i_ts_remove(struct platform_device *pdev)
385385

386386
/* Deactivate all IRQs */
387387
writel(0, ts->base + TP_INT_FIFOC);
388-
389-
return 0;
390388
}
391389

392390
static const struct of_device_id sun4i_ts_of_match[] = {
@@ -403,7 +401,7 @@ static struct platform_driver sun4i_ts_driver = {
403401
.of_match_table = sun4i_ts_of_match,
404402
},
405403
.probe = sun4i_ts_probe,
406-
.remove = sun4i_ts_remove,
404+
.remove_new = sun4i_ts_remove,
407405
};
408406

409407
module_platform_driver(sun4i_ts_driver);

0 commit comments

Comments
 (0)