diff mbox series

[3/6] iommu/msm: do some cleanup

Message ID 20230705130416.46710-3-frank.li@vivo.com (mailing list archive)
State Not Applicable
Headers show
Series [1/6] iommu/arm-smmu: do some cleanup | expand

Commit Message

Yangtao Li July 5, 2023, 1:04 p.m. UTC
Convert to devm_platform_get_and_ioremap_resource(), remove redundant msg
and fix return value when platform_get_irq fails.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/iommu/msm_iommu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 79d89bad5132..349b46b4b714 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -735,17 +735,16 @@  static int msm_iommu_probe(struct platform_device *pdev)
 		return dev_err_probe(iommu->dev, ret, "could not prepare iommu_clk\n");
 	}
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	iommu->base = devm_ioremap_resource(iommu->dev, r);
+	iommu->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
 	if (IS_ERR(iommu->base)) {
-		ret = dev_err_probe(iommu->dev, PTR_ERR(iommu->base), "could not get iommu base\n");
+		ret = PTR_ERR(iommu->base);
 		goto fail;
 	}
 	ioaddr = r->start;
 
 	iommu->irq = platform_get_irq(pdev, 0);
 	if (iommu->irq < 0) {
-		ret = -ENODEV;
+		ret = iommu->irq;
 		goto fail;
 	}