Skip to content

Commit b436514

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/touchscreen/da9052_tsi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int da9052_ts_probe(struct platform_device *pdev)
311311
return error;
312312
}
313313

314-
static int da9052_ts_remove(struct platform_device *pdev)
314+
static void da9052_ts_remove(struct platform_device *pdev)
315315
{
316316
struct da9052_tsi *tsi = platform_get_drvdata(pdev);
317317

@@ -322,13 +322,11 @@ static int da9052_ts_remove(struct platform_device *pdev)
322322

323323
input_unregister_device(tsi->dev);
324324
kfree(tsi);
325-
326-
return 0;
327325
}
328326

329327
static struct platform_driver da9052_tsi_driver = {
330328
.probe = da9052_ts_probe,
331-
.remove = da9052_ts_remove,
329+
.remove_new = da9052_ts_remove,
332330
.driver = {
333331
.name = "da9052-tsi",
334332
},

0 commit comments

Comments
 (0)