Skip to content

Commit 5930df6

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/omap: 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 (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>
1 parent 85e1049 commit 5930df6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/iommu/omap-iommu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
12571257
return err;
12581258
}
12591259

1260-
static int omap_iommu_remove(struct platform_device *pdev)
1260+
static void omap_iommu_remove(struct platform_device *pdev)
12611261
{
12621262
struct omap_iommu *obj = platform_get_drvdata(pdev);
12631263

@@ -1274,7 +1274,6 @@ static int omap_iommu_remove(struct platform_device *pdev)
12741274
pm_runtime_disable(obj->dev);
12751275

12761276
dev_info(&pdev->dev, "%s removed\n", obj->name);
1277-
return 0;
12781277
}
12791278

12801279
static const struct dev_pm_ops omap_iommu_pm_ops = {
@@ -1295,7 +1294,7 @@ static const struct of_device_id omap_iommu_of_match[] = {
12951294

12961295
static struct platform_driver omap_iommu_driver = {
12971296
.probe = omap_iommu_probe,
1298-
.remove = omap_iommu_remove,
1297+
.remove_new = omap_iommu_remove,
12991298
.driver = {
13001299
.name = "omap-iommu",
13011300
.pm = &omap_iommu_pm_ops,

0 commit comments

Comments
 (0)