Skip to content

Commit b3dff2e

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
pmdomain: imx-pgc: 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 6341e97 commit b3dff2e

File tree

1 file changed

+2
-4
lines changed
  • drivers/pmdomain/imx

1 file changed

+2
-4
lines changed

drivers/pmdomain/imx/gpc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
212212
return ret;
213213
}
214214

215-
static int imx_pgc_power_domain_remove(struct platform_device *pdev)
215+
static void imx_pgc_power_domain_remove(struct platform_device *pdev)
216216
{
217217
struct imx_pm_domain *domain = pdev->dev.platform_data;
218218

@@ -221,8 +221,6 @@ static int imx_pgc_power_domain_remove(struct platform_device *pdev)
221221
pm_genpd_remove(&domain->base);
222222
imx_pgc_put_clocks(domain);
223223
}
224-
225-
return 0;
226224
}
227225

228226
static const struct platform_device_id imx_pgc_power_domain_id[] = {
@@ -235,7 +233,7 @@ static struct platform_driver imx_pgc_power_domain_driver = {
235233
.name = "imx-pgc-pd",
236234
},
237235
.probe = imx_pgc_power_domain_probe,
238-
.remove = imx_pgc_power_domain_remove,
236+
.remove_new = imx_pgc_power_domain_remove,
239237
.id_table = imx_pgc_power_domain_id,
240238
};
241239
builtin_platform_driver(imx_pgc_power_domain_driver)

0 commit comments

Comments
 (0)