iommu/omap: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 21 Mar 2023 08:41:24 +0000 (09:41 +0100)
committerJoerg Roedel <jroedel@suse.de>
Fri, 31 Mar 2023 08:01:59 +0000 (10:01 +0200)
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 (mostly) ignored
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.

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>
Link: https://lore.kernel.org/r/20230321084125.337021-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/omap-iommu.c

index 3ab078112a7c76d7b387bbd63d40f9c5c9c41b5d..dec7cdcfbe9c564287932bd4eb2e1c0acf2a149b 100644 (file)
@@ -1257,7 +1257,7 @@ out_group:
        return err;
 }
 
-static int omap_iommu_remove(struct platform_device *pdev)
+static void omap_iommu_remove(struct platform_device *pdev)
 {
        struct omap_iommu *obj = platform_get_drvdata(pdev);
 
@@ -1274,7 +1274,6 @@ static int omap_iommu_remove(struct platform_device *pdev)
        pm_runtime_disable(obj->dev);
 
        dev_info(&pdev->dev, "%s removed\n", obj->name);
-       return 0;
 }
 
 static const struct dev_pm_ops omap_iommu_pm_ops = {
@@ -1295,7 +1294,7 @@ static const struct of_device_id omap_iommu_of_match[] = {
 
 static struct platform_driver omap_iommu_driver = {
        .probe  = omap_iommu_probe,
-       .remove = omap_iommu_remove,
+       .remove_new = omap_iommu_remove,
        .driver = {
                .name   = "omap-iommu",
                .pm     = &omap_iommu_pm_ops,