Skip to content

Commit 150e792

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: ioc3kbd - 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/20230920125829.1478827-37-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2e760e9 commit 150e792

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/input/serio/ioc3kbd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,19 @@ static int ioc3kbd_probe(struct platform_device *pdev)
190190
return 0;
191191
}
192192

193-
static int ioc3kbd_remove(struct platform_device *pdev)
193+
static void ioc3kbd_remove(struct platform_device *pdev)
194194
{
195195
struct ioc3kbd_data *d = platform_get_drvdata(pdev);
196196

197197
free_irq(d->irq, d);
198198

199199
serio_unregister_port(d->kbd);
200200
serio_unregister_port(d->aux);
201-
202-
return 0;
203201
}
204202

205203
static struct platform_driver ioc3kbd_driver = {
206204
.probe = ioc3kbd_probe,
207-
.remove = ioc3kbd_remove,
205+
.remove_new = ioc3kbd_remove,
208206
.driver = {
209207
.name = "ioc3-kbd",
210208
},

0 commit comments

Comments
 (0)