diff options
| -rw-r--r-- | drivers/pci/host/pci-tegra.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 7356741de36b..2e9888a0635a 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c | |||
| @@ -1031,32 +1031,21 @@ static int tegra_pcie_get_resources(struct tegra_pcie *pcie) | |||
| 1031 | return err; | 1031 | return err; |
| 1032 | } | 1032 | } |
| 1033 | 1033 | ||
| 1034 | /* request and remap controller registers */ | ||
| 1035 | pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads"); | 1034 | pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads"); |
| 1036 | if (!pads) { | 1035 | pcie->pads = devm_ioremap_resource(&pdev->dev, pads); |
| 1037 | err = -EADDRNOTAVAIL; | 1036 | if (IS_ERR(pcie->pads)) { |
| 1037 | err = PTR_ERR(pcie->pads); | ||
| 1038 | goto poweroff; | 1038 | goto poweroff; |
| 1039 | } | 1039 | } |
| 1040 | 1040 | ||
| 1041 | afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi"); | 1041 | afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi"); |
| 1042 | if (!afi) { | 1042 | pcie->afi = devm_ioremap_resource(&pdev->dev, afi); |
| 1043 | err = -EADDRNOTAVAIL; | 1043 | if (IS_ERR(pcie->afi)) { |
| 1044 | goto poweroff; | 1044 | err = PTR_ERR(pcie->afi); |
| 1045 | } | ||
| 1046 | |||
| 1047 | pcie->pads = devm_request_and_ioremap(&pdev->dev, pads); | ||
| 1048 | if (!pcie->pads) { | ||
| 1049 | err = -EADDRNOTAVAIL; | ||
| 1050 | goto poweroff; | ||
| 1051 | } | ||
| 1052 | |||
| 1053 | pcie->afi = devm_request_and_ioremap(&pdev->dev, afi); | ||
| 1054 | if (!pcie->afi) { | ||
| 1055 | err = -EADDRNOTAVAIL; | ||
| 1056 | goto poweroff; | 1045 | goto poweroff; |
| 1057 | } | 1046 | } |
| 1058 | 1047 | ||
| 1059 | /* request and remap configuration space */ | 1048 | /* request configuration space, but remap later, on demand */ |
| 1060 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs"); | 1049 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs"); |
| 1061 | if (!res) { | 1050 | if (!res) { |
| 1062 | err = -EADDRNOTAVAIL; | 1051 | err = -EADDRNOTAVAIL; |
| @@ -1492,9 +1481,9 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie) | |||
| 1492 | rp->lanes = value; | 1481 | rp->lanes = value; |
| 1493 | rp->pcie = pcie; | 1482 | rp->pcie = pcie; |
| 1494 | 1483 | ||
| 1495 | rp->base = devm_request_and_ioremap(pcie->dev, &rp->regs); | 1484 | rp->base = devm_ioremap_resource(pcie->dev, &rp->regs); |
| 1496 | if (!rp->base) | 1485 | if (IS_ERR(rp->base)) |
| 1497 | return -EADDRNOTAVAIL; | 1486 | return PTR_ERR(rp->base); |
| 1498 | 1487 | ||
| 1499 | list_add_tail(&rp->list, &pcie->ports); | 1488 | list_add_tail(&rp->list, &pcie->ports); |
| 1500 | } | 1489 | } |
