Skip to content

Commit 2e760e9

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

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/input/serio/i8042.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,13 +1584,11 @@ static int i8042_probe(struct platform_device *dev)
15841584
return error;
15851585
}
15861586

1587-
static int i8042_remove(struct platform_device *dev)
1587+
static void i8042_remove(struct platform_device *dev)
15881588
{
15891589
i8042_unregister_ports();
15901590
i8042_free_irqs();
15911591
i8042_controller_reset(false);
1592-
1593-
return 0;
15941592
}
15951593

15961594
static struct platform_driver i8042_driver = {
@@ -1601,7 +1599,7 @@ static struct platform_driver i8042_driver = {
16011599
#endif
16021600
},
16031601
.probe = i8042_probe,
1604-
.remove = i8042_remove,
1602+
.remove_new = i8042_remove,
16051603
.shutdown = i8042_shutdown,
16061604
};
16071605

0 commit comments

Comments
 (0)