3fd561db3a69d99d8aba8830254e1c5fdb788fca
[openwrt/openwrt.git] / target / linux / mvebu / patches-4.19 / 523-Revert-PCI-aardvark-Convert-to-use-pci_host_probe.patch
1 From 5e79c0c381eb085a2aa2da175eedea1950f07520 Mon Sep 17 00:00:00 2001
2 From: Tomasz Maciej Nowak <tomek_n@o2.pl>
3 Date: Tue, 30 Apr 2019 15:37:34 +0200
4 Subject: [PATCH] Revert "PCI: aardvark: Convert to use pci_host_probe()"
5
6 This reverts commit c8e144f8ab00e6c4a070a932ef9c57db09aa41cf.
7 ---
8 drivers/pci/controller/pci-aardvark.c | 12 +++++++++++-
9 1 file changed, 11 insertions(+), 1 deletion(-)
10
11 --- a/drivers/pci/controller/pci-aardvark.c
12 +++ b/drivers/pci/controller/pci-aardvark.c
13 @@ -843,6 +843,7 @@ static int advk_pcie_probe(struct platfo
14 struct device *dev = &pdev->dev;
15 struct advk_pcie *pcie;
16 struct resource *res;
17 + struct pci_bus *bus, *child;
18 struct pci_host_bridge *bridge;
19 int ret, irq;
20
21 @@ -896,13 +897,22 @@ static int advk_pcie_probe(struct platfo
22 bridge->map_irq = of_irq_parse_and_map_pci;
23 bridge->swizzle_irq = pci_common_swizzle;
24
25 - ret = pci_host_probe(bridge);
26 + ret = pci_scan_root_bus_bridge(bridge);
27 if (ret < 0) {
28 advk_pcie_remove_msi_irq_domain(pcie);
29 advk_pcie_remove_irq_domain(pcie);
30 return ret;
31 }
32
33 + bus = bridge->bus;
34 +
35 + pci_bus_size_bridges(bus);
36 + pci_bus_assign_resources(bus);
37 +
38 + list_for_each_entry(child, &bus->children, node)
39 + pcie_bus_configure_settings(child);
40 +
41 + pci_bus_add_devices(bus);
42 return 0;
43 }
44