Skip to content

Commit 02bb3ec

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: mainstone-wm97xx - 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 b436514 commit 02bb3ec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/input/touchscreen/mainstone-wm97xx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,16 @@ static int mainstone_wm97xx_probe(struct platform_device *pdev)
252252
return wm97xx_register_mach_ops(wm, &mainstone_mach_ops);
253253
}
254254

255-
static int mainstone_wm97xx_remove(struct platform_device *pdev)
255+
static void mainstone_wm97xx_remove(struct platform_device *pdev)
256256
{
257257
struct wm97xx *wm = platform_get_drvdata(pdev);
258258

259259
wm97xx_unregister_mach_ops(wm);
260-
261-
return 0;
262260
}
263261

264262
static struct platform_driver mainstone_wm97xx_driver = {
265263
.probe = mainstone_wm97xx_probe,
266-
.remove = mainstone_wm97xx_remove,
264+
.remove_new = mainstone_wm97xx_remove,
267265
.driver = {
268266
.name = "wm97xx-touch",
269267
},

0 commit comments

Comments
 (0)