Skip to content

Commit d85a9d1

Browse files
Uwe Kleine-Königandersson
authored andcommitted
soc: qcom: llcc-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(). 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230925095532.1984344-20-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent dd714c5 commit d85a9d1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/soc/qcom/llcc-qcom.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,11 +1080,10 @@ static int qcom_llcc_get_cfg_index(struct platform_device *pdev, u8 *cfg_index,
10801080
return ret;
10811081
}
10821082

1083-
static int qcom_llcc_remove(struct platform_device *pdev)
1083+
static void qcom_llcc_remove(struct platform_device *pdev)
10841084
{
10851085
/* Set the global pointer to a error code to avoid referencing it */
10861086
drv_data = ERR_PTR(-ENODEV);
1087-
return 0;
10881087
}
10891088

10901089
static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, u8 index,
@@ -1260,7 +1259,7 @@ static struct platform_driver qcom_llcc_driver = {
12601259
.of_match_table = qcom_llcc_of_match,
12611260
},
12621261
.probe = qcom_llcc_probe,
1263-
.remove = qcom_llcc_remove,
1262+
.remove_new = qcom_llcc_remove,
12641263
};
12651264
module_platform_driver(qcom_llcc_driver);
12661265

0 commit comments

Comments
 (0)