Skip to content

Commit c8fd5a3

Browse files
Uwe Kleine-KönigGeorgi Djakov
authored andcommitted
interconnect: 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 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 drivers use qcom_icc_rpmh_remove() as remove callback which returns zero unconditionally. Make it return void and use .remove_new in the drivers. There is no change in behaviour. 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/20231015135955.1537751-2-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
1 parent 3642b4e commit c8fd5a3

19 files changed

Lines changed: 19 additions & 21 deletions

drivers/interconnect/qcom/icc-rpmh.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,12 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev)
253253
}
254254
EXPORT_SYMBOL_GPL(qcom_icc_rpmh_probe);
255255

256-
int qcom_icc_rpmh_remove(struct platform_device *pdev)
256+
void qcom_icc_rpmh_remove(struct platform_device *pdev)
257257
{
258258
struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
259259

260260
icc_provider_deregister(&qp->provider);
261261
icc_nodes_remove(&qp->provider);
262-
263-
return 0;
264262
}
265263
EXPORT_SYMBOL_GPL(qcom_icc_rpmh_remove);
266264

drivers/interconnect/qcom/icc-rpmh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ int qcom_icc_set(struct icc_node *src, struct icc_node *dst);
126126
int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev);
127127
void qcom_icc_pre_aggregate(struct icc_node *node);
128128
int qcom_icc_rpmh_probe(struct platform_device *pdev);
129-
int qcom_icc_rpmh_remove(struct platform_device *pdev);
129+
void qcom_icc_rpmh_remove(struct platform_device *pdev);
130130

131131
#endif

drivers/interconnect/qcom/qdu1000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
10451045

10461046
static struct platform_driver qnoc_driver = {
10471047
.probe = qnoc_probe,
1048-
.remove = qcom_icc_rpmh_remove,
1048+
.remove_new = qcom_icc_rpmh_remove,
10491049
.driver = {
10501050
.name = "qnoc-qdu1000",
10511051
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sa8775p.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
25192519

25202520
static struct platform_driver qnoc_driver = {
25212521
.probe = qcom_icc_rpmh_probe,
2522-
.remove = qcom_icc_rpmh_remove,
2522+
.remove_new = qcom_icc_rpmh_remove,
25232523
.driver = {
25242524
.name = "qnoc-sa8775p",
25252525
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sc7180.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
18061806

18071807
static struct platform_driver qnoc_driver = {
18081808
.probe = qcom_icc_rpmh_probe,
1809-
.remove = qcom_icc_rpmh_remove,
1809+
.remove_new = qcom_icc_rpmh_remove,
18101810
.driver = {
18111811
.name = "qnoc-sc7180",
18121812
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sc7280.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
18341834

18351835
static struct platform_driver qnoc_driver = {
18361836
.probe = qcom_icc_rpmh_probe,
1837-
.remove = qcom_icc_rpmh_remove,
1837+
.remove_new = qcom_icc_rpmh_remove,
18381838
.driver = {
18391839
.name = "qnoc-sc7280",
18401840
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sc8180x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
18871887

18881888
static struct platform_driver qnoc_driver = {
18891889
.probe = qcom_icc_rpmh_probe,
1890-
.remove = qcom_icc_rpmh_remove,
1890+
.remove_new = qcom_icc_rpmh_remove,
18911891
.driver = {
18921892
.name = "qnoc-sc8180x",
18931893
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sc8280xp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
23902390

23912391
static struct platform_driver qnoc_driver = {
23922392
.probe = qcom_icc_rpmh_probe,
2393-
.remove = qcom_icc_rpmh_remove,
2393+
.remove_new = qcom_icc_rpmh_remove,
23942394
.driver = {
23952395
.name = "qnoc-sc8280xp",
23962396
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sdm670.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
15321532

15331533
static struct platform_driver qnoc_driver = {
15341534
.probe = qcom_icc_rpmh_probe,
1535-
.remove = qcom_icc_rpmh_remove,
1535+
.remove_new = qcom_icc_rpmh_remove,
15361536
.driver = {
15371537
.name = "qnoc-sdm670",
15381538
.of_match_table = qnoc_of_match,

drivers/interconnect/qcom/sdm845.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
18011801

18021802
static struct platform_driver qnoc_driver = {
18031803
.probe = qcom_icc_rpmh_probe,
1804-
.remove = qcom_icc_rpmh_remove,
1804+
.remove_new = qcom_icc_rpmh_remove,
18051805
.driver = {
18061806
.name = "qnoc-sdm845",
18071807
.of_match_table = qnoc_of_match,

0 commit comments

Comments
 (0)