]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/pci/probe.c
PCI: workaround hard-wired bus number V2
[mv-sheeva.git] / drivers / pci / probe.c
index 7fc7e14118cc2a7e9f1a2fab9568974010afe864..71eac9cd724d7b12c77d68cc0eb68a3b50a9f287 100644 (file)
@@ -651,6 +651,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
        dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
                secondary, subordinate, pass);
 
+       if (!primary && (primary != bus->number) && secondary && subordinate) {
+               dev_warn(&dev->dev, "Primary bus is hard wired to 0\n");
+               primary = bus->number;
+       }
+
        /* Check if setup is sensible at all */
        if (!pass &&
            (primary != bus->number || secondary <= bus->number)) {
@@ -1623,7 +1628,8 @@ struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
 }
 EXPORT_SYMBOL(pci_scan_root_bus);
 
-struct pci_bus *pci_create_bus(struct device *parent,
+/* Deprecated; use pci_scan_root_bus() instead */
+struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
                int bus, struct pci_ops *ops, void *sysdata)
 {
        LIST_HEAD(resources);
@@ -1632,22 +1638,32 @@ struct pci_bus *pci_create_bus(struct device *parent,
        pci_add_resource(&resources, &ioport_resource);
        pci_add_resource(&resources, &iomem_resource);
        b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
-       if (!b)
+       if (b)
+               b->subordinate = pci_scan_child_bus(b);
+       else
                pci_free_resource_list(&resources);
        return b;
 }
+EXPORT_SYMBOL(pci_scan_bus_parented);
 
-struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
-               int bus, struct pci_ops *ops, void *sysdata)
+struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
+                                       void *sysdata)
 {
+       LIST_HEAD(resources);
        struct pci_bus *b;
 
-       b = pci_create_bus(parent, bus, ops, sysdata);
-       if (b)
+       pci_add_resource(&resources, &ioport_resource);
+       pci_add_resource(&resources, &iomem_resource);
+       b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
+       if (b) {
                b->subordinate = pci_scan_child_bus(b);
+               pci_bus_add_devices(b);
+       } else {
+               pci_free_resource_list(&resources);
+       }
        return b;
 }
-EXPORT_SYMBOL(pci_scan_bus_parented);
+EXPORT_SYMBOL(pci_scan_bus);
 
 #ifdef CONFIG_HOTPLUG
 /**