aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/pci_dn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 29852688ceaa..d225d99fe39d 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -176,11 +176,14 @@ static void *is_devfn_node(struct device_node *dn, void *data)
176 */ 176 */
177struct device_node *fetch_dev_dn(struct pci_dev *dev) 177struct device_node *fetch_dev_dn(struct pci_dev *dev)
178{ 178{
179 struct device_node *orig_dn = dev->dev.of_node; 179 struct pci_controller *phb = dev->sysdata;
180 struct device_node *dn; 180 struct device_node *dn;
181 unsigned long searchval = (dev->bus->number << 8) | dev->devfn; 181 unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
182 182
183 dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval); 183 if (WARN_ON(!phb))
184 return NULL;
185
186 dn = traverse_pci_devices(phb->dn, is_devfn_node, (void *)searchval);
184 if (dn) 187 if (dn)
185 dev->dev.of_node = dn; 188 dev->dev.of_node = dn;
186 return dn; 189 return dn;