| .. | .. |
|---|
| 43 | 43 | struct iproc_pcie *pcie; |
|---|
| 44 | 44 | struct device_node *np = dev->of_node; |
|---|
| 45 | 45 | struct resource reg; |
|---|
| 46 | | - resource_size_t iobase = 0; |
|---|
| 47 | | - LIST_HEAD(resources); |
|---|
| 48 | 46 | struct pci_host_bridge *bridge; |
|---|
| 49 | 47 | int ret; |
|---|
| 50 | 48 | |
|---|
| .. | .. |
|---|
| 87 | 85 | |
|---|
| 88 | 86 | /* |
|---|
| 89 | 87 | * DT nodes are not used by all platforms that use the iProc PCIe |
|---|
| 90 | | - * core driver. For platforms that require explict inbound mapping |
|---|
| 88 | + * core driver. For platforms that require explicit inbound mapping |
|---|
| 91 | 89 | * configuration, "dma-ranges" would have been present in DT |
|---|
| 92 | 90 | */ |
|---|
| 93 | 91 | pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges"); |
|---|
| 94 | 92 | |
|---|
| 95 | 93 | /* PHY use is optional */ |
|---|
| 96 | | - pcie->phy = devm_phy_get(dev, "pcie-phy"); |
|---|
| 97 | | - if (IS_ERR(pcie->phy)) { |
|---|
| 98 | | - if (PTR_ERR(pcie->phy) == -EPROBE_DEFER) |
|---|
| 99 | | - return -EPROBE_DEFER; |
|---|
| 100 | | - pcie->phy = NULL; |
|---|
| 101 | | - } |
|---|
| 102 | | - |
|---|
| 103 | | - ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &resources, |
|---|
| 104 | | - &iobase); |
|---|
| 105 | | - if (ret) { |
|---|
| 106 | | - dev_err(dev, "unable to get PCI host bridge resources\n"); |
|---|
| 107 | | - return ret; |
|---|
| 108 | | - } |
|---|
| 94 | + pcie->phy = devm_phy_optional_get(dev, "pcie-phy"); |
|---|
| 95 | + if (IS_ERR(pcie->phy)) |
|---|
| 96 | + return PTR_ERR(pcie->phy); |
|---|
| 109 | 97 | |
|---|
| 110 | 98 | /* PAXC doesn't support legacy IRQs, skip mapping */ |
|---|
| 111 | 99 | switch (pcie->type) { |
|---|
| 112 | 100 | case IPROC_PCIE_PAXC: |
|---|
| 113 | 101 | case IPROC_PCIE_PAXC_V2: |
|---|
| 102 | + pcie->map_irq = NULL; |
|---|
| 114 | 103 | break; |
|---|
| 115 | 104 | default: |
|---|
| 116 | | - pcie->map_irq = of_irq_parse_and_map_pci; |
|---|
| 105 | + break; |
|---|
| 117 | 106 | } |
|---|
| 118 | 107 | |
|---|
| 119 | | - ret = iproc_pcie_setup(pcie, &resources); |
|---|
| 108 | + ret = iproc_pcie_setup(pcie, &bridge->windows); |
|---|
| 120 | 109 | if (ret) { |
|---|
| 121 | 110 | dev_err(dev, "PCIe controller setup failed\n"); |
|---|
| 122 | | - pci_free_resource_list(&resources); |
|---|
| 123 | 111 | return ret; |
|---|
| 124 | 112 | } |
|---|
| 125 | 113 | |
|---|