Commit c4dc24da authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Bjorn Andersson

clk: qcom: 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 (mostly) ignored
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.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230312161512.2715500-23-u.kleine-koenig@pengutronix.de
parent fe15c26e
...@@ -119,18 +119,16 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) ...@@ -119,18 +119,16 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int qcom_apcs_msm8916_clk_remove(struct platform_device *pdev) static void qcom_apcs_msm8916_clk_remove(struct platform_device *pdev)
{ {
struct clk_regmap_mux_div *a53cc = platform_get_drvdata(pdev); struct clk_regmap_mux_div *a53cc = platform_get_drvdata(pdev);
clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb); clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb);
return 0;
} }
static struct platform_driver qcom_apcs_msm8916_clk_driver = { static struct platform_driver qcom_apcs_msm8916_clk_driver = {
.probe = qcom_apcs_msm8916_clk_probe, .probe = qcom_apcs_msm8916_clk_probe,
.remove = qcom_apcs_msm8916_clk_remove, .remove_new = qcom_apcs_msm8916_clk_remove,
.driver = { .driver = {
.name = "qcom-apcs-msm8916-clk", .name = "qcom-apcs-msm8916-clk",
}, },
......
...@@ -120,20 +120,18 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev) ...@@ -120,20 +120,18 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int qcom_apcs_sdx55_clk_remove(struct platform_device *pdev) static void qcom_apcs_sdx55_clk_remove(struct platform_device *pdev)
{ {
struct device *cpu_dev = get_cpu_device(0); struct device *cpu_dev = get_cpu_device(0);
struct clk_regmap_mux_div *a7cc = platform_get_drvdata(pdev); struct clk_regmap_mux_div *a7cc = platform_get_drvdata(pdev);
clk_notifier_unregister(a7cc->pclk, &a7cc->clk_nb); clk_notifier_unregister(a7cc->pclk, &a7cc->clk_nb);
dev_pm_domain_detach(cpu_dev, true); dev_pm_domain_detach(cpu_dev, true);
return 0;
} }
static struct platform_driver qcom_apcs_sdx55_clk_driver = { static struct platform_driver qcom_apcs_sdx55_clk_driver = {
.probe = qcom_apcs_sdx55_clk_probe, .probe = qcom_apcs_sdx55_clk_probe,
.remove = qcom_apcs_sdx55_clk_remove, .remove_new = qcom_apcs_sdx55_clk_remove,
.driver = { .driver = {
.name = "qcom-sdx55-acps-clk", .name = "qcom-sdx55-acps-clk",
}, },
......
...@@ -591,10 +591,9 @@ static int rpm_clk_probe(struct platform_device *pdev) ...@@ -591,10 +591,9 @@ static int rpm_clk_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int rpm_clk_remove(struct platform_device *pdev) static void rpm_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static struct platform_driver rpm_clk_driver = { static struct platform_driver rpm_clk_driver = {
...@@ -603,7 +602,7 @@ static struct platform_driver rpm_clk_driver = { ...@@ -603,7 +602,7 @@ static struct platform_driver rpm_clk_driver = {
.of_match_table = rpm_clk_match_table, .of_match_table = rpm_clk_match_table,
}, },
.probe = rpm_clk_probe, .probe = rpm_clk_probe,
.remove = rpm_clk_remove, .remove_new = rpm_clk_remove,
}; };
static int __init rpm_clk_init(void) static int __init rpm_clk_init(void)
......
...@@ -3754,19 +3754,17 @@ static int gcc_msm8960_probe(struct platform_device *pdev) ...@@ -3754,19 +3754,17 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int gcc_msm8960_remove(struct platform_device *pdev) static void gcc_msm8960_remove(struct platform_device *pdev)
{ {
struct platform_device *tsens = platform_get_drvdata(pdev); struct platform_device *tsens = platform_get_drvdata(pdev);
if (tsens) if (tsens)
platform_device_unregister(tsens); platform_device_unregister(tsens);
return 0;
} }
static struct platform_driver gcc_msm8960_driver = { static struct platform_driver gcc_msm8960_driver = {
.probe = gcc_msm8960_probe, .probe = gcc_msm8960_probe,
.remove = gcc_msm8960_remove, .remove_new = gcc_msm8960_remove,
.driver = { .driver = {
.name = "gcc-msm8960", .name = "gcc-msm8960",
.of_match_table = gcc_msm8960_match_table, .of_match_table = gcc_msm8960_match_table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment