Skip to content

Commit f9059eb

Browse files
bbkzzdlezcano
authored andcommitted
cpuidle: kirkwood: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20230712094014.41787-1-frank.li@vivo.com
1 parent ed30a4a commit f9059eb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/cpuidle/cpuidle-kirkwood.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,14 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev)
5959
return cpuidle_register(&kirkwood_idle_driver, NULL);
6060
}
6161

62-
static int kirkwood_cpuidle_remove(struct platform_device *pdev)
62+
static void kirkwood_cpuidle_remove(struct platform_device *pdev)
6363
{
6464
cpuidle_unregister(&kirkwood_idle_driver);
65-
return 0;
6665
}
6766

6867
static struct platform_driver kirkwood_cpuidle_driver = {
6968
.probe = kirkwood_cpuidle_probe,
70-
.remove = kirkwood_cpuidle_remove,
69+
.remove_new = kirkwood_cpuidle_remove,
7170
.driver = {
7271
.name = "kirkwood_cpuidle",
7372
},

0 commit comments

Comments
 (0)