diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-25 11:55:29 +0200 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2023-10-02 16:11:46 +0200 |
commit | ba03aab9bfb4c9d456419da3891375d45c6bfe15 (patch) | |
tree | 8a97b3c25608e897751e3144f02f0a96a9e521dc /drivers | |
parent | soc/ti: pruss: Convert to platform remove callback returning void (diff) | |
download | linux-ba03aab9bfb4c9d456419da3891375d45c6bfe15.tar.xz linux-ba03aab9bfb4c9d456419da3891375d45c6bfe15.zip |
soc/ti: smartreflex: 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-39-u.kleine-koenig@pengutronix.de
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/ti/smartreflex.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c index 62b2f1464e46..d6219060b616 100644 --- a/drivers/soc/ti/smartreflex.c +++ b/drivers/soc/ti/smartreflex.c @@ -933,7 +933,7 @@ err_list_del: return ret; } -static int omap_sr_remove(struct platform_device *pdev) +static void omap_sr_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct omap_sr *sr_info = platform_get_drvdata(pdev); @@ -945,7 +945,6 @@ static int omap_sr_remove(struct platform_device *pdev) pm_runtime_disable(dev); clk_unprepare(sr_info->fck); list_del(&sr_info->node); - return 0; } static void omap_sr_shutdown(struct platform_device *pdev) @@ -970,7 +969,7 @@ MODULE_DEVICE_TABLE(of, omap_sr_match); static struct platform_driver smartreflex_driver = { .probe = omap_sr_probe, - .remove = omap_sr_remove, + .remove_new = omap_sr_remove, .shutdown = omap_sr_shutdown, .driver = { .name = DRIVER_NAME, |