MIPS: pci: use devm_platform_ioremap_resource_byname
authorZhang Qilong <zhangqilong3@huawei.com>
Thu, 17 Sep 2020 07:46:22 +0000 (15:46 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 18 Sep 2020 13:29:35 +0000 (15:29 +0200)
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/pci/pci-ar2315.c
arch/mips/pci/pci-ar71xx.c
arch/mips/pci/pci-ar724x.c

index 490953f515282af4776efb371dedfc72667b3335..d1b141e8f301c3b9ccda8b59edad7b8b3b40338f 100644 (file)
@@ -423,9 +423,8 @@ static int ar2315_pci_probe(struct platform_device *pdev)
                return -EINVAL;
        apc->irq = irq;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-                                          "ar2315-pci-ctrl");
-       apc->mmr_mem = devm_ioremap_resource(dev, res);
+       apc->mmr_mem = devm_platform_ioremap_resource_byname(pdev,
+                                                            "ar2315-pci-ctrl");
        if (IS_ERR(apc->mmr_mem))
                return PTR_ERR(apc->mmr_mem);
 
index a9f8e7c881bdf1d7c249bdbe1db65893806c27d5..118760b3fa8241b753548bdb678b8bb738d0da61 100644 (file)
@@ -336,8 +336,8 @@ static int ar71xx_pci_probe(struct platform_device *pdev)
        if (!apc)
                return -ENOMEM;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
-       apc->cfg_base = devm_ioremap_resource(&pdev->dev, res);
+       apc->cfg_base = devm_platform_ioremap_resource_byname(pdev,
+                                                             "cfg_base");
        if (IS_ERR(apc->cfg_base))
                return PTR_ERR(apc->cfg_base);
 
index 869d5c9a2f8d7e5ed82bc31a4066669aa543860a..807558b251efa75886d22a9e0cd675ed5df2be87 100644 (file)
@@ -372,18 +372,15 @@ static int ar724x_pci_probe(struct platform_device *pdev)
        if (!apc)
                return -ENOMEM;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl_base");
-       apc->ctrl_base = devm_ioremap_resource(&pdev->dev, res);
+       apc->ctrl_base = devm_platform_ioremap_resource_byname(pdev, "ctrl_base");
        if (IS_ERR(apc->ctrl_base))
                return PTR_ERR(apc->ctrl_base);
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
-       apc->devcfg_base = devm_ioremap_resource(&pdev->dev, res);
+       apc->devcfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg_base");
        if (IS_ERR(apc->devcfg_base))
                return PTR_ERR(apc->devcfg_base);
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "crp_base");
-       apc->crp_base = devm_ioremap_resource(&pdev->dev, res);
+       apc->crp_base = devm_platform_ioremap_resource_byname(pdev, "crp_base");
        if (IS_ERR(apc->crp_base))
                return PTR_ERR(apc->crp_base);