PCI: rcar: Consolidate register space lookup and ioremap
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 22 Aug 2016 19:16:38 +0000 (14:16 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 22 Aug 2016 19:16:38 +0000 (14:16 -0500)
Move the devm_ioremap_resource() of R-Car register space next to the
of_address_to_resource() that extracts the resource.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pci/host/pcie-rcar.c

index 65db7a2215090ff4508141dc131fb37104b9a34b..e58bbbc0f0b5d164223f1ea1df3292891f470ca6 100644 (file)
@@ -775,6 +775,10 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
        if (err)
                return err;
 
+       pcie->base = devm_ioremap_resource(&pdev->dev, &res);
+       if (IS_ERR(pcie->base))
+               return PTR_ERR(pcie->base);
+
        pcie->clk = devm_clk_get(&pdev->dev, "pcie");
        if (IS_ERR(pcie->clk)) {
                dev_err(pcie->dev, "cannot get platform clock\n");
@@ -810,12 +814,6 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
        }
        pcie->msi.irq2 = i;
 
-       pcie->base = devm_ioremap_resource(&pdev->dev, &res);
-       if (IS_ERR(pcie->base)) {
-               err = PTR_ERR(pcie->base);
-               goto err_map_reg;
-       }
-
        return 0;
 
 err_map_reg: