Skip to content

Commit 9c3c167

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: olpc_apsp - 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-39-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent b72729b commit 9c3c167

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/input/serio/olpc_apsp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,14 @@ static int olpc_apsp_probe(struct platform_device *pdev)
238238
return error;
239239
}
240240

241-
static int olpc_apsp_remove(struct platform_device *pdev)
241+
static void olpc_apsp_remove(struct platform_device *pdev)
242242
{
243243
struct olpc_apsp *priv = platform_get_drvdata(pdev);
244244

245245
free_irq(priv->irq, priv);
246246

247247
serio_unregister_port(priv->kbio);
248248
serio_unregister_port(priv->padio);
249-
250-
return 0;
251249
}
252250

253251
static const struct of_device_id olpc_apsp_dt_ids[] = {
@@ -258,7 +256,7 @@ MODULE_DEVICE_TABLE(of, olpc_apsp_dt_ids);
258256

259257
static struct platform_driver olpc_apsp_driver = {
260258
.probe = olpc_apsp_probe,
261-
.remove = olpc_apsp_remove,
259+
.remove_new = olpc_apsp_remove,
262260
.driver = {
263261
.name = "olpc-apsp",
264262
.of_match_table = olpc_apsp_dt_ids,

0 commit comments

Comments
 (0)