Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uwe Kleine-König and committed by
Joerg Roedel
7471ea50 62565a77

+2 -4
+2 -4
drivers/iommu/ipmmu-vmsa.c
··· 1073 1073 return 0; 1074 1074 } 1075 1075 1076 - static int ipmmu_remove(struct platform_device *pdev) 1076 + static void ipmmu_remove(struct platform_device *pdev) 1077 1077 { 1078 1078 struct ipmmu_vmsa_device *mmu = platform_get_drvdata(pdev); 1079 1079 ··· 1083 1083 arm_iommu_release_mapping(mmu->mapping); 1084 1084 1085 1085 ipmmu_device_reset(mmu); 1086 - 1087 - return 0; 1088 1086 } 1089 1087 1090 1088 #ifdef CONFIG_PM_SLEEP ··· 1129 1131 .pm = DEV_PM_OPS, 1130 1132 }, 1131 1133 .probe = ipmmu_probe, 1132 - .remove = ipmmu_remove, 1134 + .remove_new = ipmmu_remove, 1133 1135 }; 1134 1136 builtin_platform_driver(ipmmu_driver);