diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-25 11:55:17 +0200 |
---|---|---|
committer | Bjorn Andersson <andersson@kernel.org> | 2023-10-02 20:30:28 +0200 |
commit | 4b8dee9a34d51a61f60add996fae6a7140a20ae5 (patch) | |
tree | 01d3eee571beb2858cf3c37f5a14f3e73c10cf63 /drivers | |
parent | soc: qcom: rmtfs_mem: Convert to platform remove callback returning void (diff) | |
download | linux-4b8dee9a34d51a61f60add996fae6a7140a20ae5.tar.xz linux-4b8dee9a34d51a61f60add996fae6a7140a20ae5.zip |
soc: qcom: smem: 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> # qcom
Link: https://lore.kernel.org/r/20230925095532.1984344-27-u.kleine-koenig@pengutronix.de
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/qcom/smem.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 0e644806f897..690afc9a12f4 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -1187,14 +1187,12 @@ static int qcom_smem_probe(struct platform_device *pdev) return 0; } -static int qcom_smem_remove(struct platform_device *pdev) +static void qcom_smem_remove(struct platform_device *pdev) { platform_device_unregister(__smem->socinfo); hwspin_lock_free(__smem->hwlock); __smem = NULL; - - return 0; } static const struct of_device_id qcom_smem_of_match[] = { @@ -1205,7 +1203,7 @@ MODULE_DEVICE_TABLE(of, qcom_smem_of_match); static struct platform_driver qcom_smem_driver = { .probe = qcom_smem_probe, - .remove = qcom_smem_remove, + .remove_new = qcom_smem_remove, .driver = { .name = "qcom-smem", .of_match_table = qcom_smem_of_match, |