summaryrefslogtreecommitdiffstats
path: root/drivers/pci/host/pcie-rcar.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-08-22 14:16:38 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-08-22 14:16:38 -0500
commit51afa3cc2ded60884aed3aaac8d8c416e3cf6324 (patch)
tree00d70253020a7d401d37ab790ce2274833051f4f /drivers/pci/host/pcie-rcar.c
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
downloadlinux-51afa3cc2ded60884aed3aaac8d8c416e3cf6324.tar.bz2
PCI: rcar: Consolidate register space lookup and ioremap
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>
Diffstat (limited to 'drivers/pci/host/pcie-rcar.c')
-rw-r--r--drivers/pci/host/pcie-rcar.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 65db7a221509..e58bbbc0f0b5 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -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: