Skip to content

Commit 42b8ff4

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: amimouse - 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 <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231201133747.1099286-2-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 335fe00 commit 42b8ff4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/input/mouse/amimouse.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,15 @@ static int __init amimouse_probe(struct platform_device *pdev)
125125
return 0;
126126
}
127127

128-
static int __exit amimouse_remove(struct platform_device *pdev)
128+
static void __exit amimouse_remove(struct platform_device *pdev)
129129
{
130130
struct input_dev *dev = platform_get_drvdata(pdev);
131131

132132
input_unregister_device(dev);
133-
return 0;
134133
}
135134

136135
static struct platform_driver amimouse_driver = {
137-
.remove = __exit_p(amimouse_remove),
136+
.remove_new = __exit_p(amimouse_remove),
138137
.driver = {
139138
.name = "amiga-mouse",
140139
},

0 commit comments

Comments
 (0)