Skip to content

Commit 816a4af

Browse files
Uwe Kleine-Königjoergroedel
authored andcommitted
iommu/msm: 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-7-u.kleine-koenig@pengutronix.de Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 7471ea5 commit 816a4af

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/iommu/msm_iommu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,12 @@ static const struct of_device_id msm_iommu_dt_match[] = {
811811
{}
812812
};
813813

814-
static int msm_iommu_remove(struct platform_device *pdev)
814+
static void msm_iommu_remove(struct platform_device *pdev)
815815
{
816816
struct msm_iommu_dev *iommu = platform_get_drvdata(pdev);
817817

818818
clk_unprepare(iommu->clk);
819819
clk_unprepare(iommu->pclk);
820-
return 0;
821820
}
822821

823822
static struct platform_driver msm_iommu_driver = {
@@ -826,6 +825,6 @@ static struct platform_driver msm_iommu_driver = {
826825
.of_match_table = msm_iommu_dt_match,
827826
},
828827
.probe = msm_iommu_probe,
829-
.remove = msm_iommu_remove,
828+
.remove_new = msm_iommu_remove,
830829
};
831830
builtin_platform_driver(msm_iommu_driver);

0 commit comments

Comments
 (0)