Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230312161512.2715500-23-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Bjorn Andersson
c4dc24da fe15c26e

+8 -15
+2 -4
drivers/clk/qcom/apcs-msm8916.c
··· 119 119 return ret; 120 120 } 121 121 122 - static int qcom_apcs_msm8916_clk_remove(struct platform_device *pdev) 122 + static void qcom_apcs_msm8916_clk_remove(struct platform_device *pdev) 123 123 { 124 124 struct clk_regmap_mux_div *a53cc = platform_get_drvdata(pdev); 125 125 126 126 clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb); 127 - 128 - return 0; 129 127 } 130 128 131 129 static struct platform_driver qcom_apcs_msm8916_clk_driver = { 132 130 .probe = qcom_apcs_msm8916_clk_probe, 133 - .remove = qcom_apcs_msm8916_clk_remove, 131 + .remove_new = qcom_apcs_msm8916_clk_remove, 134 132 .driver = { 135 133 .name = "qcom-apcs-msm8916-clk", 136 134 },
+2 -4
drivers/clk/qcom/apcs-sdx55.c
··· 120 120 return ret; 121 121 } 122 122 123 - static int qcom_apcs_sdx55_clk_remove(struct platform_device *pdev) 123 + static void qcom_apcs_sdx55_clk_remove(struct platform_device *pdev) 124 124 { 125 125 struct device *cpu_dev = get_cpu_device(0); 126 126 struct clk_regmap_mux_div *a7cc = platform_get_drvdata(pdev); 127 127 128 128 clk_notifier_unregister(a7cc->pclk, &a7cc->clk_nb); 129 129 dev_pm_domain_detach(cpu_dev, true); 130 - 131 - return 0; 132 130 } 133 131 134 132 static struct platform_driver qcom_apcs_sdx55_clk_driver = { 135 133 .probe = qcom_apcs_sdx55_clk_probe, 136 - .remove = qcom_apcs_sdx55_clk_remove, 134 + .remove_new = qcom_apcs_sdx55_clk_remove, 137 135 .driver = { 138 136 .name = "qcom-sdx55-acps-clk", 139 137 },
+2 -3
drivers/clk/qcom/clk-rpm.c
··· 591 591 return ret; 592 592 } 593 593 594 - static int rpm_clk_remove(struct platform_device *pdev) 594 + static void rpm_clk_remove(struct platform_device *pdev) 595 595 { 596 596 of_clk_del_provider(pdev->dev.of_node); 597 - return 0; 598 597 } 599 598 600 599 static struct platform_driver rpm_clk_driver = { ··· 602 603 .of_match_table = rpm_clk_match_table, 603 604 }, 604 605 .probe = rpm_clk_probe, 605 - .remove = rpm_clk_remove, 606 + .remove_new = rpm_clk_remove, 606 607 }; 607 608 608 609 static int __init rpm_clk_init(void)
+2 -4
drivers/clk/qcom/gcc-msm8960.c
··· 3754 3754 return 0; 3755 3755 } 3756 3756 3757 - static int gcc_msm8960_remove(struct platform_device *pdev) 3757 + static void gcc_msm8960_remove(struct platform_device *pdev) 3758 3758 { 3759 3759 struct platform_device *tsens = platform_get_drvdata(pdev); 3760 3760 3761 3761 if (tsens) 3762 3762 platform_device_unregister(tsens); 3763 - 3764 - return 0; 3765 3763 } 3766 3764 3767 3765 static struct platform_driver gcc_msm8960_driver = { 3768 3766 .probe = gcc_msm8960_probe, 3769 - .remove = gcc_msm8960_remove, 3767 + .remove_new = gcc_msm8960_remove, 3770 3768 .driver = { 3771 3769 .name = "gcc-msm8960", 3772 3770 .of_match_table = gcc_msm8960_match_table,