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

iommu/omap: 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-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Uwe Kleine-König and committed by
Joerg Roedel
5930df68 85e1049e

+2 -3
+2 -3
drivers/iommu/omap-iommu.c
··· 1257 1257 return err; 1258 1258 } 1259 1259 1260 - static int omap_iommu_remove(struct platform_device *pdev) 1260 + static void omap_iommu_remove(struct platform_device *pdev) 1261 1261 { 1262 1262 struct omap_iommu *obj = platform_get_drvdata(pdev); 1263 1263 ··· 1274 1274 pm_runtime_disable(obj->dev); 1275 1275 1276 1276 dev_info(&pdev->dev, "%s removed\n", obj->name); 1277 - return 0; 1278 1277 } 1279 1278 1280 1279 static const struct dev_pm_ops omap_iommu_pm_ops = { ··· 1294 1295 1295 1296 static struct platform_driver omap_iommu_driver = { 1296 1297 .probe = omap_iommu_probe, 1297 - .remove = omap_iommu_remove, 1298 + .remove_new = omap_iommu_remove, 1298 1299 .driver = { 1299 1300 .name = "omap-iommu", 1300 1301 .pm = &omap_iommu_pm_ops,