Skip to content

Commit 697bc6c

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
pmdomain: imx-gpcv2: 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 da07c58 commit 697bc6c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pmdomain/imx/gpcv2.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ static int imx_pgc_domain_probe(struct platform_device *pdev)
13731373
return ret;
13741374
}
13751375

1376-
static int imx_pgc_domain_remove(struct platform_device *pdev)
1376+
static void imx_pgc_domain_remove(struct platform_device *pdev)
13771377
{
13781378
struct imx_pgc_domain *domain = pdev->dev.platform_data;
13791379

@@ -1385,8 +1385,6 @@ static int imx_pgc_domain_remove(struct platform_device *pdev)
13851385
domain->bits.map, 0);
13861386

13871387
pm_runtime_disable(domain->dev);
1388-
1389-
return 0;
13901388
}
13911389

13921390
#ifdef CONFIG_PM_SLEEP
@@ -1430,7 +1428,7 @@ static struct platform_driver imx_pgc_domain_driver = {
14301428
.pm = &imx_pgc_domain_pm_ops,
14311429
},
14321430
.probe = imx_pgc_domain_probe,
1433-
.remove = imx_pgc_domain_remove,
1431+
.remove_new = imx_pgc_domain_remove,
14341432
.id_table = imx_pgc_domain_id,
14351433
};
14361434
builtin_platform_driver(imx_pgc_domain_driver)

0 commit comments

Comments
 (0)