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.

interconnect: qcom: Make qnoc_remove return 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().

Several interconnect/qcom drivers use qnoc_remove() as remove callback.
Make this function return void (instead of unconditionally zero) and
adapt the drivers using this function accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231031222851.3126434-12-u.kleine-koenig@pengutronix.de
Signed-off-by: Georgi Djakov <djakov@kernel.org>

authored by

Uwe Kleine-König and committed by
Georgi Djakov
772f8890 b85ea95d

+8 -10
+1 -3
drivers/interconnect/qcom/icc-rpm.c
··· 627 627 } 628 628 EXPORT_SYMBOL(qnoc_probe); 629 629 630 - int qnoc_remove(struct platform_device *pdev) 630 + void qnoc_remove(struct platform_device *pdev) 631 631 { 632 632 struct qcom_icc_provider *qp = platform_get_drvdata(pdev); 633 633 634 634 icc_provider_deregister(&qp->provider); 635 635 icc_nodes_remove(&qp->provider); 636 636 clk_disable_unprepare(qp->bus_clk); 637 - 638 - return 0; 639 637 } 640 638 EXPORT_SYMBOL(qnoc_remove);
+1 -1
drivers/interconnect/qcom/icc-rpm.h
··· 161 161 extern const struct rpm_clk_resource aggre2_branch_clk; 162 162 163 163 int qnoc_probe(struct platform_device *pdev); 164 - int qnoc_remove(struct platform_device *pdev); 164 + void qnoc_remove(struct platform_device *pdev); 165 165 166 166 bool qcom_icc_rpm_smd_available(void); 167 167 int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val);
+1 -1
drivers/interconnect/qcom/msm8916.c
··· 1344 1344 1345 1345 static struct platform_driver msm8916_noc_driver = { 1346 1346 .probe = qnoc_probe, 1347 - .remove = qnoc_remove, 1347 + .remove_new = qnoc_remove, 1348 1348 .driver = { 1349 1349 .name = "qnoc-msm8916", 1350 1350 .of_match_table = msm8916_noc_of_match,
+1 -1
drivers/interconnect/qcom/msm8939.c
··· 1421 1421 1422 1422 static struct platform_driver msm8939_noc_driver = { 1423 1423 .probe = qnoc_probe, 1424 - .remove = qnoc_remove, 1424 + .remove_new = qnoc_remove, 1425 1425 .driver = { 1426 1426 .name = "qnoc-msm8939", 1427 1427 .of_match_table = msm8939_noc_of_match,
+1 -1
drivers/interconnect/qcom/msm8996.c
··· 2108 2108 2109 2109 static struct platform_driver qnoc_driver = { 2110 2110 .probe = qnoc_probe, 2111 - .remove = qnoc_remove, 2111 + .remove_new = qnoc_remove, 2112 2112 .driver = { 2113 2113 .name = "qnoc-msm8996", 2114 2114 .of_match_table = qnoc_of_match,
+1 -1
drivers/interconnect/qcom/qcm2290.c
··· 1367 1367 1368 1368 static struct platform_driver qcm2290_noc_driver = { 1369 1369 .probe = qnoc_probe, 1370 - .remove = qnoc_remove, 1370 + .remove_new = qnoc_remove, 1371 1371 .driver = { 1372 1372 .name = "qnoc-qcm2290", 1373 1373 .of_match_table = qcm2290_noc_of_match,
+1 -1
drivers/interconnect/qcom/qcs404.c
··· 1083 1083 1084 1084 static struct platform_driver qcs404_noc_driver = { 1085 1085 .probe = qnoc_probe, 1086 - .remove = qnoc_remove, 1086 + .remove_new = qnoc_remove, 1087 1087 .driver = { 1088 1088 .name = "qnoc-qcs404", 1089 1089 .of_match_table = qcs404_noc_of_match,
+1 -1
drivers/interconnect/qcom/sdm660.c
··· 1714 1714 1715 1715 static struct platform_driver sdm660_noc_driver = { 1716 1716 .probe = qnoc_probe, 1717 - .remove = qnoc_remove, 1717 + .remove_new = qnoc_remove, 1718 1718 .driver = { 1719 1719 .name = "qnoc-sdm660", 1720 1720 .of_match_table = sdm660_noc_of_match,