Skip to content

Commit 421b609

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/sprd: 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 5930df6 commit 421b609

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/iommu/sprd-iommu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static int sprd_iommu_probe(struct platform_device *pdev)
507507
return ret;
508508
}
509509

510-
static int sprd_iommu_remove(struct platform_device *pdev)
510+
static void sprd_iommu_remove(struct platform_device *pdev)
511511
{
512512
struct sprd_iommu_device *sdev = platform_get_drvdata(pdev);
513513

@@ -519,8 +519,6 @@ static int sprd_iommu_remove(struct platform_device *pdev)
519519
platform_set_drvdata(pdev, NULL);
520520
iommu_device_sysfs_remove(&sdev->iommu);
521521
iommu_device_unregister(&sdev->iommu);
522-
523-
return 0;
524522
}
525523

526524
static struct platform_driver sprd_iommu_driver = {
@@ -530,7 +528,7 @@ static struct platform_driver sprd_iommu_driver = {
530528
.suppress_bind_attrs = true,
531529
},
532530
.probe = sprd_iommu_probe,
533-
.remove = sprd_iommu_remove,
531+
.remove_new = sprd_iommu_remove,
534532
};
535533
module_platform_driver(sprd_iommu_driver);
536534

0 commit comments

Comments
 (0)