Skip to content

Commit

Permalink
iommu/omap: Convert to platform remove callback returning void
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Joerg Roedel committed Mar 31, 2023
1 parent 85e1049 commit 5930df6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/iommu/omap-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
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);

Expand All @@ -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 = {
Expand All @@ -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,
Expand Down

0 comments on commit 5930df6

Please sign in to comment.