mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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>
This commit is contained in:
parent
b85ea95d08
commit
772f88907d
@ -627,14 +627,12 @@ err_disable_unprepare_clk:
|
||||
}
|
||||
EXPORT_SYMBOL(qnoc_probe);
|
||||
|
||||
int qnoc_remove(struct platform_device *pdev)
|
||||
void qnoc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
|
||||
|
||||
icc_provider_deregister(&qp->provider);
|
||||
icc_nodes_remove(&qp->provider);
|
||||
clk_disable_unprepare(qp->bus_clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(qnoc_remove);
|
||||
|
@ -161,7 +161,7 @@ extern const struct rpm_clk_resource aggre1_branch_clk;
|
||||
extern const struct rpm_clk_resource aggre2_branch_clk;
|
||||
|
||||
int qnoc_probe(struct platform_device *pdev);
|
||||
int qnoc_remove(struct platform_device *pdev);
|
||||
void qnoc_remove(struct platform_device *pdev);
|
||||
|
||||
bool qcom_icc_rpm_smd_available(void);
|
||||
int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val);
|
||||
|
@ -1344,7 +1344,7 @@ MODULE_DEVICE_TABLE(of, msm8916_noc_of_match);
|
||||
|
||||
static struct platform_driver msm8916_noc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-msm8916",
|
||||
.of_match_table = msm8916_noc_of_match,
|
||||
|
@ -1421,7 +1421,7 @@ MODULE_DEVICE_TABLE(of, msm8939_noc_of_match);
|
||||
|
||||
static struct platform_driver msm8939_noc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-msm8939",
|
||||
.of_match_table = msm8939_noc_of_match,
|
||||
|
@ -2108,7 +2108,7 @@ MODULE_DEVICE_TABLE(of, qnoc_of_match);
|
||||
|
||||
static struct platform_driver qnoc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-msm8996",
|
||||
.of_match_table = qnoc_of_match,
|
||||
|
@ -1367,7 +1367,7 @@ MODULE_DEVICE_TABLE(of, qcm2290_noc_of_match);
|
||||
|
||||
static struct platform_driver qcm2290_noc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-qcm2290",
|
||||
.of_match_table = qcm2290_noc_of_match,
|
||||
|
@ -1083,7 +1083,7 @@ MODULE_DEVICE_TABLE(of, qcs404_noc_of_match);
|
||||
|
||||
static struct platform_driver qcs404_noc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-qcs404",
|
||||
.of_match_table = qcs404_noc_of_match,
|
||||
|
@ -1714,7 +1714,7 @@ MODULE_DEVICE_TABLE(of, sdm660_noc_of_match);
|
||||
|
||||
static struct platform_driver sdm660_noc_driver = {
|
||||
.probe = qnoc_probe,
|
||||
.remove = qnoc_remove,
|
||||
.remove_new = qnoc_remove,
|
||||
.driver = {
|
||||
.name = "qnoc-sdm660",
|
||||
.of_match_table = sdm660_noc_of_match,
|
||||
|
Loading…
Reference in New Issue
Block a user