Skip to content

Commit 20cea2b

Browse files
Uwe Kleine-Königsre
authored andcommitted
power: reset: at91-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> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> Link: https://lore.kernel.org/r/20231105094712.3706799-3-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 0bf7207 commit 20cea2b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/power/reset/at91-reset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,19 +417,17 @@ static int at91_reset_probe(struct platform_device *pdev)
417417
return ret;
418418
}
419419

420-
static int at91_reset_remove(struct platform_device *pdev)
420+
static void at91_reset_remove(struct platform_device *pdev)
421421
{
422422
struct at91_reset *reset = platform_get_drvdata(pdev);
423423

424424
unregister_restart_handler(&reset->nb);
425425
clk_disable_unprepare(reset->sclk);
426-
427-
return 0;
428426
}
429427

430428
static struct platform_driver at91_reset_driver = {
431429
.probe = at91_reset_probe,
432-
.remove = at91_reset_remove,
430+
.remove_new = at91_reset_remove,
433431
.driver = {
434432
.name = "at91-reset",
435433
.of_match_table = at91_reset_of_match,

0 commit comments

Comments
 (0)