Skip to content

Commit 7471ea5

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/ipmmu-vmsa: 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-6-u.kleine-koenig@pengutronix.de Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 62565a7 commit 7471ea5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/iommu/ipmmu-vmsa.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ static int ipmmu_probe(struct platform_device *pdev)
10731073
return 0;
10741074
}
10751075

1076-
static int ipmmu_remove(struct platform_device *pdev)
1076+
static void ipmmu_remove(struct platform_device *pdev)
10771077
{
10781078
struct ipmmu_vmsa_device *mmu = platform_get_drvdata(pdev);
10791079

@@ -1083,8 +1083,6 @@ static int ipmmu_remove(struct platform_device *pdev)
10831083
arm_iommu_release_mapping(mmu->mapping);
10841084

10851085
ipmmu_device_reset(mmu);
1086-
1087-
return 0;
10881086
}
10891087

10901088
#ifdef CONFIG_PM_SLEEP
@@ -1131,6 +1129,6 @@ static struct platform_driver ipmmu_driver = {
11311129
.pm = DEV_PM_OPS,
11321130
},
11331131
.probe = ipmmu_probe,
1134-
.remove = ipmmu_remove,
1132+
.remove_new = ipmmu_remove,
11351133
};
11361134
builtin_platform_driver(ipmmu_driver);

0 commit comments

Comments
 (0)