Skip to content

Commit 30d26d2

Browse files
Uwe Kleine-Königsre
authored andcommitted
power: reset: rmobile-reset: 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/20231104211501.3676352-28-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent aedd4da commit 30d26d2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/power/reset/rmobile-reset.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ static int rmobile_reset_probe(struct platform_device *pdev)
5959
return error;
6060
}
6161

62-
static int rmobile_reset_remove(struct platform_device *pdev)
62+
static void rmobile_reset_remove(struct platform_device *pdev)
6363
{
6464
unregister_restart_handler(&rmobile_reset_nb);
6565
iounmap(sysc_base2);
66-
return 0;
6766
}
6867

6968
static const struct of_device_id rmobile_reset_of_match[] = {
@@ -74,7 +73,7 @@ MODULE_DEVICE_TABLE(of, rmobile_reset_of_match);
7473

7574
static struct platform_driver rmobile_reset_driver = {
7675
.probe = rmobile_reset_probe,
77-
.remove = rmobile_reset_remove,
76+
.remove_new = rmobile_reset_remove,
7877
.driver = {
7978
.name = "rmobile_reset",
8079
.of_match_table = rmobile_reset_of_match,

0 commit comments

Comments
 (0)