pinctrl: qcom/msm: 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().

To convert all those qcom pinctrl drivers, make msm_pinctrl_remove()
return void (instead of zero) and use .remove_new in all drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009162510.335208-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Uwe Kleine-König 2023-10-09 18:25:09 +02:00 committed by Linus Walleij
parent 776d54c137
commit 22ee670a8a
49 changed files with 49 additions and 51 deletions

View File

@ -629,7 +629,7 @@ static struct platform_driver apq8064_pinctrl_driver = {
.of_match_table = apq8064_pinctrl_of_match,
},
.probe = apq8064_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init apq8064_pinctrl_init(void)

View File

@ -1207,7 +1207,7 @@ static struct platform_driver apq8084_pinctrl_driver = {
.of_match_table = apq8084_pinctrl_of_match,
},
.probe = apq8084_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init apq8084_pinctrl_init(void)

View File

@ -710,7 +710,7 @@ static struct platform_driver ipq4019_pinctrl_driver = {
.of_match_table = ipq4019_pinctrl_of_match,
},
.probe = ipq4019_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq4019_pinctrl_init(void)

View File

@ -754,7 +754,7 @@ static struct platform_driver ipq5018_pinctrl_driver = {
.of_match_table = ipq5018_pinctrl_of_match,
},
.probe = ipq5018_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq5018_pinctrl_init(void)

View File

@ -834,7 +834,7 @@ static struct platform_driver ipq5332_pinctrl_driver = {
.of_match_table = ipq5332_pinctrl_of_match,
},
.probe = ipq5332_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq5332_pinctrl_init(void)

View File

@ -1080,7 +1080,7 @@ static struct platform_driver ipq6018_pinctrl_driver = {
.of_match_table = ipq6018_pinctrl_of_match,
},
.probe = ipq6018_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq6018_pinctrl_init(void)

View File

@ -631,7 +631,7 @@ static struct platform_driver ipq8064_pinctrl_driver = {
.of_match_table = ipq8064_pinctrl_of_match,
},
.probe = ipq8064_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq8064_pinctrl_init(void)

View File

@ -1041,7 +1041,7 @@ static struct platform_driver ipq8074_pinctrl_driver = {
.of_match_table = ipq8074_pinctrl_of_match,
},
.probe = ipq8074_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq8074_pinctrl_init(void)

View File

@ -799,7 +799,7 @@ static struct platform_driver ipq9574_pinctrl_driver = {
.of_match_table = ipq9574_pinctrl_of_match,
},
.probe = ipq9574_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init ipq9574_pinctrl_init(void)

View File

@ -1059,7 +1059,7 @@ static struct platform_driver mdm9607_pinctrl_driver = {
.of_match_table = mdm9607_pinctrl_of_match,
},
.probe = mdm9607_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init mdm9607_pinctrl_init(void)

View File

@ -446,7 +446,7 @@ static struct platform_driver mdm9615_pinctrl_driver = {
.of_match_table = mdm9615_pinctrl_of_match,
},
.probe = mdm9615_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init mdm9615_pinctrl_init(void)

View File

@ -1547,15 +1547,13 @@ int msm_pinctrl_probe(struct platform_device *pdev,
}
EXPORT_SYMBOL(msm_pinctrl_probe);
int msm_pinctrl_remove(struct platform_device *pdev)
void msm_pinctrl_remove(struct platform_device *pdev)
{
struct msm_pinctrl *pctrl = platform_get_drvdata(pdev);
gpiochip_remove(&pctrl->chip);
unregister_restart_handler(&pctrl->restart_nb);
return 0;
}
EXPORT_SYMBOL(msm_pinctrl_remove);

View File

@ -166,6 +166,6 @@ extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
int msm_pinctrl_probe(struct platform_device *pdev,
const struct msm_pinctrl_soc_data *soc_data);
int msm_pinctrl_remove(struct platform_device *pdev);
void msm_pinctrl_remove(struct platform_device *pdev);
#endif

View File

@ -654,7 +654,7 @@ static struct platform_driver msm8226_pinctrl_driver = {
.of_match_table = msm8226_pinctrl_of_match,
},
.probe = msm8226_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8226_pinctrl_init(void)

View File

@ -981,7 +981,7 @@ static struct platform_driver msm8660_pinctrl_driver = {
.of_match_table = msm8660_pinctrl_of_match,
},
.probe = msm8660_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8660_pinctrl_init(void)

View File

@ -929,7 +929,7 @@ static struct platform_driver msm8909_pinctrl_driver = {
.of_match_table = msm8909_pinctrl_of_match,
},
.probe = msm8909_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8909_pinctrl_init(void)

View File

@ -969,7 +969,7 @@ static struct platform_driver msm8916_pinctrl_driver = {
.of_match_table = msm8916_pinctrl_of_match,
},
.probe = msm8916_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8916_pinctrl_init(void)

View File

@ -1816,7 +1816,7 @@ static struct platform_driver msm8953_pinctrl_driver = {
.of_match_table = msm8953_pinctrl_of_match,
},
.probe = msm8953_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8953_pinctrl_init(void)

View File

@ -1246,7 +1246,7 @@ static struct platform_driver msm8960_pinctrl_driver = {
.of_match_table = msm8960_pinctrl_of_match,
},
.probe = msm8960_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8960_pinctrl_init(void)

View File

@ -1096,7 +1096,7 @@ static struct platform_driver msm8976_pinctrl_driver = {
.of_match_table = msm8976_pinctrl_of_match,
},
.probe = msm8976_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8976_pinctrl_init(void)

View File

@ -1343,7 +1343,7 @@ static struct platform_driver msm8994_pinctrl_driver = {
.of_match_table = msm8994_pinctrl_of_match,
},
.probe = msm8994_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8994_pinctrl_init(void)

View File

@ -1920,7 +1920,7 @@ static struct platform_driver msm8996_pinctrl_driver = {
.of_match_table = msm8996_pinctrl_of_match,
},
.probe = msm8996_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8996_pinctrl_init(void)

View File

@ -1535,7 +1535,7 @@ static struct platform_driver msm8998_pinctrl_driver = {
.of_match_table = msm8998_pinctrl_of_match,
},
.probe = msm8998_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8998_pinctrl_init(void)

View File

@ -1083,7 +1083,7 @@ static struct platform_driver msm8x74_pinctrl_driver = {
.of_match_table = msm8x74_pinctrl_of_match,
},
.probe = msm8x74_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init msm8x74_pinctrl_init(void)

View File

@ -1113,7 +1113,7 @@ static struct platform_driver qcm2290_pinctrl_driver = {
.of_match_table = qcm2290_pinctrl_of_match,
},
.probe = qcm2290_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init qcm2290_pinctrl_init(void)

View File

@ -1644,7 +1644,7 @@ static struct platform_driver qcs404_pinctrl_driver = {
.of_match_table = qcs404_pinctrl_of_match,
},
.probe = qcs404_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init qcs404_pinctrl_init(void)

View File

@ -145,7 +145,7 @@ static struct platform_driver qdf2xxx_pinctrl_driver = {
.acpi_match_table = qdf2xxx_acpi_ids,
},
.probe = qdf2xxx_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init qdf2xxx_pinctrl_init(void)

View File

@ -1248,7 +1248,7 @@ static struct platform_driver qdu1000_tlmm_driver = {
.of_match_table = qdu1000_tlmm_of_match,
},
.probe = qdu1000_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init qdu1000_tlmm_init(void)

View File

@ -1530,7 +1530,7 @@ static struct platform_driver sa8775p_pinctrl_driver = {
.of_match_table = sa8775p_pinctrl_of_match,
},
.probe = sa8775p_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sa8775p_pinctrl_init(void)

View File

@ -1159,7 +1159,7 @@ static struct platform_driver sc7180_pinctrl_driver = {
.of_match_table = sc7180_pinctrl_of_match,
},
.probe = sc7180_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sc7180_pinctrl_init(void)

View File

@ -1505,7 +1505,7 @@ static struct platform_driver sc7280_pinctrl_driver = {
.of_match_table = sc7280_pinctrl_of_match,
},
.probe = sc7280_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sc7280_pinctrl_init(void)

View File

@ -1720,7 +1720,7 @@ static struct platform_driver sc8180x_pinctrl_driver = {
.acpi_match_table = sc8180x_pinctrl_acpi_match,
},
.probe = sc8180x_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sc8180x_pinctrl_init(void)

View File

@ -1926,7 +1926,7 @@ static struct platform_driver sc8280xp_pinctrl_driver = {
.of_match_table = sc8280xp_pinctrl_of_match,
},
.probe = sc8280xp_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sc8280xp_pinctrl_init(void)

View File

@ -1442,7 +1442,7 @@ static struct platform_driver sdm660_pinctrl_driver = {
.of_match_table = sdm660_pinctrl_of_match,
},
.probe = sdm660_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdm660_pinctrl_init(void)

View File

@ -1318,7 +1318,7 @@ static struct platform_driver sdm670_pinctrl_driver = {
.of_match_table = sdm670_pinctrl_of_match,
},
.probe = sdm670_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdm670_pinctrl_init(void)

View File

@ -1351,7 +1351,7 @@ static struct platform_driver sdm845_pinctrl_driver = {
.acpi_match_table = ACPI_PTR(sdm845_pinctrl_acpi_match),
},
.probe = sdm845_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdm845_pinctrl_init(void)

View File

@ -990,7 +990,7 @@ static struct platform_driver sdx55_pinctrl_driver = {
.of_match_table = sdx55_pinctrl_of_match,
},
.probe = sdx55_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdx55_pinctrl_init(void)

View File

@ -939,7 +939,7 @@ static struct platform_driver sdx65_pinctrl_driver = {
.of_match_table = sdx65_pinctrl_of_match,
},
.probe = sdx65_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdx65_pinctrl_init(void)

View File

@ -1124,7 +1124,7 @@ static struct platform_driver sdx75_pinctrl_driver = {
.of_match_table = sdx75_pinctrl_of_match,
},
.probe = sdx75_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sdx75_pinctrl_init(void)

View File

@ -907,7 +907,7 @@ static struct platform_driver sm6115_tlmm_driver = {
.of_match_table = sm6115_tlmm_of_match,
},
.probe = sm6115_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm6115_tlmm_init(void)

View File

@ -1266,7 +1266,7 @@ static struct platform_driver sm6125_tlmm_driver = {
.of_match_table = sm6125_tlmm_of_match,
},
.probe = sm6125_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm6125_tlmm_init(void)

View File

@ -1373,7 +1373,7 @@ static struct platform_driver sm6350_tlmm_driver = {
.of_match_table = sm6350_tlmm_of_match,
},
.probe = sm6350_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm6350_tlmm_init(void)

View File

@ -1516,7 +1516,7 @@ static struct platform_driver sm6375_tlmm_driver = {
.of_match_table = sm6375_tlmm_of_match,
},
.probe = sm6375_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm6375_tlmm_init(void)

View File

@ -1254,7 +1254,7 @@ static struct platform_driver sm7150_tlmm_driver = {
.of_match_table = sm7150_tlmm_of_match,
},
.probe = sm7150_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm7150_tlmm_init(void)

View File

@ -1542,7 +1542,7 @@ static struct platform_driver sm8150_pinctrl_driver = {
.of_match_table = sm8150_pinctrl_of_match,
},
.probe = sm8150_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm8150_pinctrl_init(void)

View File

@ -1351,7 +1351,7 @@ static struct platform_driver sm8250_pinctrl_driver = {
.of_match_table = sm8250_pinctrl_of_match,
},
.probe = sm8250_pinctrl_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm8250_pinctrl_init(void)

View File

@ -1642,7 +1642,7 @@ static struct platform_driver sm8350_tlmm_driver = {
.of_match_table = sm8350_tlmm_of_match,
},
.probe = sm8350_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm8350_tlmm_init(void)

View File

@ -1677,7 +1677,7 @@ static struct platform_driver sm8450_tlmm_driver = {
.of_match_table = sm8450_tlmm_of_match,
},
.probe = sm8450_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm8450_tlmm_init(void)

View File

@ -1762,7 +1762,7 @@ static struct platform_driver sm8550_tlmm_driver = {
.of_match_table = sm8550_tlmm_of_match,
},
.probe = sm8550_tlmm_probe,
.remove = msm_pinctrl_remove,
.remove_new = msm_pinctrl_remove,
};
static int __init sm8550_tlmm_init(void)