Skip to content

Commit 33984b4

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: wm831x-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: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d722a70 commit 33984b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/touchscreen/wm831x-ts.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,22 +374,20 @@ static int wm831x_ts_probe(struct platform_device *pdev)
374374
return error;
375375
}
376376

377-
static int wm831x_ts_remove(struct platform_device *pdev)
377+
static void wm831x_ts_remove(struct platform_device *pdev)
378378
{
379379
struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
380380

381381
free_irq(wm831x_ts->pd_irq, wm831x_ts);
382382
free_irq(wm831x_ts->data_irq, wm831x_ts);
383-
384-
return 0;
385383
}
386384

387385
static struct platform_driver wm831x_ts_driver = {
388386
.driver = {
389387
.name = "wm831x-touch",
390388
},
391389
.probe = wm831x_ts_probe,
392-
.remove = wm831x_ts_remove,
390+
.remove_new = wm831x_ts_remove,
393391
};
394392
module_platform_driver(wm831x_ts_driver);
395393

0 commit comments

Comments
 (0)