diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-21 09:41:20 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-03-31 10:01:57 +0200 |
commit | 7471ea50eae448953126c285e8ee0351db5e2b44 (patch) | |
tree | 5ac555bd0788d0ff55969e40f3139c736f233fdb /drivers/iommu/ipmmu-vmsa.c | |
parent | 62565a77c2323d32f2be737455729ac7d3efe6ad (diff) | |
download | lwn-7471ea50eae448953126c285e8ee0351db5e2b44.tar.gz lwn-7471ea50eae448953126c285e8ee0351db5e2b44.zip |
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>
Diffstat (limited to 'drivers/iommu/ipmmu-vmsa.c')
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index bdf1a4e5eae0..813dbd1f7ba0 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -1073,7 +1073,7 @@ static int ipmmu_probe(struct platform_device *pdev) return 0; } -static int ipmmu_remove(struct platform_device *pdev) +static void ipmmu_remove(struct platform_device *pdev) { struct ipmmu_vmsa_device *mmu = platform_get_drvdata(pdev); @@ -1083,8 +1083,6 @@ static int ipmmu_remove(struct platform_device *pdev) arm_iommu_release_mapping(mmu->mapping); ipmmu_device_reset(mmu); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1131,6 +1129,6 @@ static struct platform_driver ipmmu_driver = { .pm = DEV_PM_OPS, }, .probe = ipmmu_probe, - .remove = ipmmu_remove, + .remove_new = ipmmu_remove, }; builtin_platform_driver(ipmmu_driver); |