Skip to content

Commit 02fd95e

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/touchscreen/mc13783_ts.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,16 @@ static int __init mc13783_ts_probe(struct platform_device *pdev)
217217
return ret;
218218
}
219219

220-
static int mc13783_ts_remove(struct platform_device *pdev)
220+
static void mc13783_ts_remove(struct platform_device *pdev)
221221
{
222222
struct mc13783_ts_priv *priv = platform_get_drvdata(pdev);
223223

224224
input_unregister_device(priv->idev);
225225
kfree(priv);
226-
227-
return 0;
228226
}
229227

230228
static struct platform_driver mc13783_ts_driver = {
231-
.remove = mc13783_ts_remove,
229+
.remove_new = mc13783_ts_remove,
232230
.driver = {
233231
.name = MC13783_TS_NAME,
234232
},

0 commit comments

Comments
 (0)