Skip to content

Commit 673c09b

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
pmdomain: imx93-pd: 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 77647eb commit 673c09b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pmdomain/imx/imx93-pd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int imx93_pd_off(struct generic_pm_domain *genpd)
8383
return 0;
8484
};
8585

86-
static int imx93_pd_remove(struct platform_device *pdev)
86+
static void imx93_pd_remove(struct platform_device *pdev)
8787
{
8888
struct imx93_power_domain *domain = platform_get_drvdata(pdev);
8989
struct device *dev = &pdev->dev;
@@ -94,8 +94,6 @@ static int imx93_pd_remove(struct platform_device *pdev)
9494

9595
of_genpd_del_provider(np);
9696
pm_genpd_remove(&domain->genpd);
97-
98-
return 0;
9997
}
10098

10199
static int imx93_pd_probe(struct platform_device *pdev)
@@ -167,7 +165,7 @@ static struct platform_driver imx93_power_domain_driver = {
167165
.of_match_table = imx93_pd_ids,
168166
},
169167
.probe = imx93_pd_probe,
170-
.remove = imx93_pd_remove,
168+
.remove_new = imx93_pd_remove,
171169
};
172170
module_platform_driver(imx93_power_domain_driver);
173171

0 commit comments

Comments
 (0)