[2/6] iommu/omap: do some cleanup

Message ID 20230705130416.46710-2-frank.li@vivo.com
State New
Headers
Series [1/6] iommu/arm-smmu: do some cleanup |

Commit Message

李扬韬 July 5, 2023, 1:04 p.m. UTC
  Convert to use devm_platform_ioremap_resource() and fix return value
when platform_get_irq fails.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/iommu/omap-iommu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 537e402f9bba..ed4a29478473 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1163,7 +1163,6 @@  static int omap_iommu_probe(struct platform_device *pdev)
 	int err = -ENODEV;
 	int irq;
 	struct omap_iommu *obj;
-	struct resource *res;
 	struct device_node *of = pdev->dev.of_node;
 
 	if (!of) {
@@ -1205,8 +1204,7 @@  static int omap_iommu_probe(struct platform_device *pdev)
 	spin_lock_init(&obj->iommu_lock);
 	spin_lock_init(&obj->page_table_lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	obj->regbase = devm_ioremap_resource(obj->dev, res);
+	obj->regbase = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(obj->regbase))
 		return PTR_ERR(obj->regbase);
 
@@ -1216,7 +1214,7 @@  static int omap_iommu_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
-		return -ENODEV;
+		return irq;
 
 	err = devm_request_irq(obj->dev, irq, iommu_fault_handler, IRQF_SHARED,
 			       dev_name(obj->dev), obj);