Skip to content

Commit 66c7076

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/arm-smmu-v3: 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-4-u.kleine-koenig@pengutronix.de Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent f804731 commit 66c7076

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3844,16 +3844,14 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
38443844
return 0;
38453845
}
38463846

3847-
static int arm_smmu_device_remove(struct platform_device *pdev)
3847+
static void arm_smmu_device_remove(struct platform_device *pdev)
38483848
{
38493849
struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
38503850

38513851
iommu_device_unregister(&smmu->iommu);
38523852
iommu_device_sysfs_remove(&smmu->iommu);
38533853
arm_smmu_device_disable(smmu);
38543854
iopf_queue_free(smmu->evtq.iopf);
3855-
3856-
return 0;
38573855
}
38583856

38593857
static void arm_smmu_device_shutdown(struct platform_device *pdev)
@@ -3882,7 +3880,7 @@ static struct platform_driver arm_smmu_driver = {
38823880
.suppress_bind_attrs = true,
38833881
},
38843882
.probe = arm_smmu_device_probe,
3885-
.remove = arm_smmu_device_remove,
3883+
.remove_new = arm_smmu_device_remove,
38863884
.shutdown = arm_smmu_device_shutdown,
38873885
};
38883886
module_driver(arm_smmu_driver, platform_driver_register,

0 commit comments

Comments
 (0)