kernel: update linux 3.8 to 3.8.10
[openwrt/staging/mkresin.git] / target / linux / generic / patches-3.8 / 032-MIPS-implement-pcibios_get_phb_of_node.patch
1 From fe17cba0e4efb6cf6d1e4e79fa4c6e062fe32b39 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Wed, 3 Apr 2013 19:28:50 +0200
4 Subject: [PATCH 2/2] MIPS: 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 ---
21 arch/mips/pci/pci.c | 8 +++++++-
22 1 file changed, 7 insertions(+), 1 deletion(-)
23
24 --- a/arch/mips/pci/pci.c
25 +++ b/arch/mips/pci/pci.c
26 @@ -115,7 +115,6 @@ static void pcibios_scanbus(struct pci_c
27 pci_bus_assign_resources(bus);
28 pci_enable_bridges(bus);
29 }
30 - bus->dev.of_node = hose->of_node;
31 }
32 }
33
34 @@ -169,6 +168,13 @@ void pci_load_of_ranges(struct pci_contr
35 }
36 }
37 }
38 +
39 +struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
40 +{
41 + struct pci_controller *hose = bus->sysdata;
42 +
43 + return of_node_get(hose->of_node);
44 +}
45 #endif
46
47 static DEFINE_MUTEX(pci_scan_mutex);