Skip to content

Commit 15514b9

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: apbps2 - 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-32-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent d484d0f commit 15514b9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/input/serio/apbps2.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,11 @@ static int apbps2_of_probe(struct platform_device *ofdev)
187187
return 0;
188188
}
189189

190-
static int apbps2_of_remove(struct platform_device *of_dev)
190+
static void apbps2_of_remove(struct platform_device *of_dev)
191191
{
192192
struct apbps2_priv *priv = platform_get_drvdata(of_dev);
193193

194194
serio_unregister_port(priv->io);
195-
196-
return 0;
197195
}
198196

199197
static const struct of_device_id apbps2_of_match[] = {
@@ -210,7 +208,7 @@ static struct platform_driver apbps2_of_driver = {
210208
.of_match_table = apbps2_of_match,
211209
},
212210
.probe = apbps2_of_probe,
213-
.remove = apbps2_of_remove,
211+
.remove_new = apbps2_of_remove,
214212
};
215213

216214
module_platform_driver(apbps2_of_driver);

0 commit comments

Comments
 (0)