linux/3.8: use backported pcibios_get_phb_of_node patches
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.8 / 032-MIPS-PCI-Implement-pcibios_get_phb_of_node.patch
1 From 9a97cd43f4ef62520a852b5a2348233b0f37455b Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Thu, 4 Apr 2013 20:01:23 +0200
4 Subject: [PATCH 2/2] MIPS/PCI: Implement pcibios_get_phb_of_node
5
6 The of_node field of the device assigned to a
7 PCI bus is used during scanning of the PCI bus.
8 However on MIPS, the of_node field is assigned
9 only after the bus has been scanned.
10
11 Implement the architecture specific version of
12 'pcibios_get_phb_of_node'. Which ensures that the
13 PCI driver core will initialize the of_node field
14 before starting the scan.
15
16 Also remove the local assignment of bus->dev.of_node,
17 it is not needed after the patch.
18
19 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
20 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
21 ---
22 arch/mips/pci/pci.c | 8 +++++++-
23 1 file changed, 7 insertions(+), 1 deletion(-)
24
25 --- a/arch/mips/pci/pci.c
26 +++ b/arch/mips/pci/pci.c
27 @@ -115,7 +115,6 @@ static void pcibios_scanbus(struct pci_c
28 pci_bus_assign_resources(bus);
29 pci_enable_bridges(bus);
30 }
31 - bus->dev.of_node = hose->of_node;
32 }
33 }
34
35 @@ -169,6 +168,13 @@ void pci_load_of_ranges(struct pci_contr
36 }
37 }
38 }
39 +
40 +struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
41 +{
42 + struct pci_controller *hose = bus->sysdata;
43 +
44 + return of_node_get(hose->of_node);
45 +}
46 #endif
47
48 static DEFINE_MUTEX(pci_scan_mutex);