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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 drivers/iommu/msm_iommu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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;
 	}
 
-- 
2.39.0




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux