Skip to content

Commit 99f7fa6

Browse files
Uwe Kleine-Königsre
authored andcommitted
power: reset: mt6323-poweroff: 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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20231104211501.3676352-24-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 6642b13 commit 99f7fa6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/power/reset/mt6323-poweroff.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ static int mt6323_pwrc_probe(struct platform_device *pdev)
7070
return 0;
7171
}
7272

73-
static int mt6323_pwrc_remove(struct platform_device *pdev)
73+
static void mt6323_pwrc_remove(struct platform_device *pdev)
7474
{
7575
if (pm_power_off == &mt6323_do_pwroff)
7676
pm_power_off = NULL;
77-
78-
return 0;
7977
}
8078

8179
static const struct of_device_id mt6323_pwrc_dt_match[] = {
@@ -86,7 +84,7 @@ MODULE_DEVICE_TABLE(of, mt6323_pwrc_dt_match);
8684

8785
static struct platform_driver mt6323_pwrc_driver = {
8886
.probe = mt6323_pwrc_probe,
89-
.remove = mt6323_pwrc_remove,
87+
.remove_new = mt6323_pwrc_remove,
9088
.driver = {
9189
.name = "mt6323-pwrc",
9290
.of_match_table = mt6323_pwrc_dt_match,

0 commit comments

Comments
 (0)