mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 02:33:57 +00:00
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>
This commit is contained in:
parent
62565a77c2
commit
7471ea50ea
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user