Skip to content

Commit f804731

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/apple-dart: 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-3-u.kleine-koenig@pengutronix.de Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent a2972cb commit f804731

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ static int apple_dart_probe(struct platform_device *pdev)
11501150
return ret;
11511151
}
11521152

1153-
static int apple_dart_remove(struct platform_device *pdev)
1153+
static void apple_dart_remove(struct platform_device *pdev)
11541154
{
11551155
struct apple_dart *dart = platform_get_drvdata(pdev);
11561156

@@ -1161,8 +1161,6 @@ static int apple_dart_remove(struct platform_device *pdev)
11611161
iommu_device_sysfs_remove(&dart->iommu);
11621162

11631163
clk_bulk_disable_unprepare(dart->num_clks, dart->clks);
1164-
1165-
return 0;
11661164
}
11671165

11681166
static const struct apple_dart_hw apple_dart_hw_t8103 = {
@@ -1296,7 +1294,7 @@ static struct platform_driver apple_dart_driver = {
12961294
.pm = pm_sleep_ptr(&apple_dart_pm_ops),
12971295
},
12981296
.probe = apple_dart_probe,
1299-
.remove = apple_dart_remove,
1297+
.remove_new = apple_dart_remove,
13001298
};
13011299

13021300
module_platform_driver(apple_dart_driver);

0 commit comments

Comments
 (0)