Commit 7476ddfd authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Ulf Hansson

pmdomain: imx8mp-blk-ctrl: 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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231124080623.564924-6-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent eeba3519
...@@ -760,7 +760,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev) ...@@ -760,7 +760,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int imx8mp_blk_ctrl_remove(struct platform_device *pdev) static void imx8mp_blk_ctrl_remove(struct platform_device *pdev)
{ {
struct imx8mp_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); struct imx8mp_blk_ctrl *bc = dev_get_drvdata(&pdev->dev);
int i; int i;
...@@ -777,8 +777,6 @@ static int imx8mp_blk_ctrl_remove(struct platform_device *pdev) ...@@ -777,8 +777,6 @@ static int imx8mp_blk_ctrl_remove(struct platform_device *pdev)
dev_pm_genpd_remove_notifier(bc->bus_power_dev); dev_pm_genpd_remove_notifier(bc->bus_power_dev);
dev_pm_domain_detach(bc->bus_power_dev, true); dev_pm_domain_detach(bc->bus_power_dev, true);
return 0;
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
...@@ -856,7 +854,7 @@ MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match); ...@@ -856,7 +854,7 @@ MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match);
static struct platform_driver imx8mp_blk_ctrl_driver = { static struct platform_driver imx8mp_blk_ctrl_driver = {
.probe = imx8mp_blk_ctrl_probe, .probe = imx8mp_blk_ctrl_probe,
.remove = imx8mp_blk_ctrl_remove, .remove_new = imx8mp_blk_ctrl_remove,
.driver = { .driver = {
.name = "imx8mp-blk-ctrl", .name = "imx8mp-blk-ctrl",
.pm = &imx8mp_blk_ctrl_pm_ops, .pm = &imx8mp_blk_ctrl_pm_ops,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment