PCI: fix wrong assumption in pci_read_bridge_bases
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Tue, 17 Feb 2009 05:15:16 +0000 (14:15 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 20 Mar 2009 17:48:04 +0000 (10:48 -0700)
Current pci_read_bridge_bases() has an assumption that pci_bus->self
is NULL on the pci root bus (It checks pci_bus->self to see if the pci
bus is root bus). But is might not true on some platforms. We must
check pci_bus->parent instead.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/probe.c

index 55ec44a27e89e65e8d01c750ebca0f76bcf4e152..23362e8c696fbb66a9efa68a7a9ef1a399bf0899 100644 (file)
@@ -287,7 +287,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
        struct resource *res;
        int i;
 
-       if (!dev)               /* It's a host bus, nothing to read */
+       if (!child->parent)     /* It's a host bus, nothing to read */
                return;
 
        if (dev->transparent) {