Skip to content

Commit 4b7599a

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
pmdomain: qcom-cpr: 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 673c09b commit 4b7599a

File tree

1 file changed

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

1 file changed

+2
-4
lines changed

drivers/pmdomain/qcom/cpr.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ static int cpr_probe(struct platform_device *pdev)
17121712
return ret;
17131713
}
17141714

1715-
static int cpr_remove(struct platform_device *pdev)
1715+
static void cpr_remove(struct platform_device *pdev)
17161716
{
17171717
struct cpr_drv *drv = platform_get_drvdata(pdev);
17181718

@@ -1725,8 +1725,6 @@ static int cpr_remove(struct platform_device *pdev)
17251725
pm_genpd_remove(&drv->pd);
17261726

17271727
debugfs_remove_recursive(drv->debugfs);
1728-
1729-
return 0;
17301728
}
17311729

17321730
static const struct of_device_id cpr_match_table[] = {
@@ -1737,7 +1735,7 @@ MODULE_DEVICE_TABLE(of, cpr_match_table);
17371735

17381736
static struct platform_driver cpr_driver = {
17391737
.probe = cpr_probe,
1740-
.remove = cpr_remove,
1738+
.remove_new = cpr_remove,
17411739
.driver = {
17421740
.name = "qcom-cpr",
17431741
.of_match_table = cpr_match_table,

0 commit comments

Comments
 (0)