hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pci/controller/pcie-iproc-platform.c
....@@ -43,8 +43,6 @@
4343 struct iproc_pcie *pcie;
4444 struct device_node *np = dev->of_node;
4545 struct resource reg;
46
- resource_size_t iobase = 0;
47
- LIST_HEAD(resources);
4846 struct pci_host_bridge *bridge;
4947 int ret;
5048
....@@ -87,39 +85,29 @@
8785
8886 /*
8987 * 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
9189 * configuration, "dma-ranges" would have been present in DT
9290 */
9391 pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges");
9492
9593 /* 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);
10997
11098 /* PAXC doesn't support legacy IRQs, skip mapping */
11199 switch (pcie->type) {
112100 case IPROC_PCIE_PAXC:
113101 case IPROC_PCIE_PAXC_V2:
102
+ pcie->map_irq = NULL;
114103 break;
115104 default:
116
- pcie->map_irq = of_irq_parse_and_map_pci;
105
+ break;
117106 }
118107
119
- ret = iproc_pcie_setup(pcie, &resources);
108
+ ret = iproc_pcie_setup(pcie, &bridge->windows);
120109 if (ret) {
121110 dev_err(dev, "PCIe controller setup failed\n");
122
- pci_free_resource_list(&resources);
123111 return ret;
124112 }
125113