diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-25 12:55:10 +0300 |
---|---|---|
committer | Bjorn Andersson <andersson@kernel.org> | 2023-10-02 21:30:05 +0300 |
commit | d85a9d18a58156fc8b5ab185e00e078adaaeefde (patch) | |
tree | 5142fcfbf9178d30203f82a1d8ab5dc368399d58 /drivers | |
parent | dd714c568ed4e6f79017be45077de71e9908af03 (diff) | |
download | linux-d85a9d18a58156fc8b5ab185e00e078adaaeefde.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/qcom/llcc-qcom.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index e3f262a50e4a..674abd0d6700 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -1080,11 +1080,10 @@ static int qcom_llcc_get_cfg_index(struct platform_device *pdev, u8 *cfg_index, return ret; } -static int qcom_llcc_remove(struct platform_device *pdev) +static void qcom_llcc_remove(struct platform_device *pdev) { /* Set the global pointer to a error code to avoid referencing it */ drv_data = ERR_PTR(-ENODEV); - return 0; } static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, u8 index, @@ -1260,7 +1259,7 @@ static struct platform_driver qcom_llcc_driver = { .of_match_table = qcom_llcc_of_match, }, .probe = qcom_llcc_probe, - .remove = qcom_llcc_remove, + .remove_new = qcom_llcc_remove, }; module_platform_driver(qcom_llcc_driver); |