Skip to content

Commit 0210a60

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
regulator: db8500-prcmu: 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://msgid.link/r/fcaa42d7dd707031ed8dd9e8c28483891b879965.1701778038.git.u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cddda6f commit 0210a60

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/regulator/db8500-prcmu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,9 @@ static int db8500_regulator_probe(struct platform_device *pdev)
469469
return 0;
470470
}
471471

472-
static int db8500_regulator_remove(struct platform_device *pdev)
472+
static void db8500_regulator_remove(struct platform_device *pdev)
473473
{
474474
ux500_regulator_debug_exit();
475-
476-
return 0;
477475
}
478476

479477
static struct platform_driver db8500_regulator_driver = {
@@ -482,7 +480,7 @@ static struct platform_driver db8500_regulator_driver = {
482480
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
483481
},
484482
.probe = db8500_regulator_probe,
485-
.remove = db8500_regulator_remove,
483+
.remove_new = db8500_regulator_remove,
486484
};
487485

488486
static int __init db8500_regulator_init(void)

0 commit comments

Comments
 (0)