Skip to content

Commit 7476ddf

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
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: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent eeba351 commit 7476ddf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pmdomain/imx/imx8mp-blk-ctrl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
760760
return ret;
761761
}
762762

763-
static int imx8mp_blk_ctrl_remove(struct platform_device *pdev)
763+
static void imx8mp_blk_ctrl_remove(struct platform_device *pdev)
764764
{
765765
struct imx8mp_blk_ctrl *bc = dev_get_drvdata(&pdev->dev);
766766
int i;
@@ -777,8 +777,6 @@ static int imx8mp_blk_ctrl_remove(struct platform_device *pdev)
777777
dev_pm_genpd_remove_notifier(bc->bus_power_dev);
778778

779779
dev_pm_domain_detach(bc->bus_power_dev, true);
780-
781-
return 0;
782780
}
783781

784782
#ifdef CONFIG_PM_SLEEP
@@ -856,7 +854,7 @@ MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match);
856854

857855
static struct platform_driver imx8mp_blk_ctrl_driver = {
858856
.probe = imx8mp_blk_ctrl_probe,
859-
.remove = imx8mp_blk_ctrl_remove,
857+
.remove_new = imx8mp_blk_ctrl_remove,
860858
.driver = {
861859
.name = "imx8mp-blk-ctrl",
862860
.pm = &imx8mp_blk_ctrl_pm_ops,

0 commit comments

Comments
 (0)