]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/pci/probe.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[karo-tx-linux.git] / drivers / pci / probe.c
index b494066ef32f5f08e3f5d4f4b3d88acf9257d710..631aeb7d2d2dd548d7db2ccfeae6b7518f0fc483 100644 (file)
@@ -673,6 +673,8 @@ add_dev:
        ret = device_register(&child->dev);
        WARN_ON(ret < 0);
 
+       pcibios_add_bus(child);
+
        /* Create legacy_io and legacy_mem files for this bus */
        pci_create_legacy_files(child);
 
@@ -988,7 +990,6 @@ int pci_setup_device(struct pci_dev *dev)
        dev->sysdata = dev->bus->sysdata;
        dev->dev.parent = dev->bus->bridge;
        dev->dev.bus = &pci_bus_type;
-       dev->dev.type = &pci_dev_type;
        dev->hdr_type = hdr_type & 0x7f;
        dev->multifunction = !!(hdr_type & 0x80);
        dev->error_state = pci_channel_io_normal;
@@ -1208,6 +1209,7 @@ struct pci_dev *alloc_pci_dev(void)
                return NULL;
 
        INIT_LIST_HEAD(&dev->bus_list);
+       dev->dev.type = &pci_dev_type;
 
        return dev;
 }
@@ -1627,8 +1629,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
        if (!bus->is_added) {
                dev_dbg(&bus->dev, "fixups for bus\n");
                pcibios_fixup_bus(bus);
-               if (pci_is_root_bus(bus))
-                       bus->is_added = 1;
+               bus->is_added = 1;
        }
 
        for (pass=0; pass < 2; pass++)
@@ -1661,6 +1662,14 @@ int __weak pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
        return 0;
 }
 
+void __weak pcibios_add_bus(struct pci_bus *bus)
+{
+}
+
+void __weak pcibios_remove_bus(struct pci_bus *bus)
+{
+}
+
 struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
                struct pci_ops *ops, void *sysdata, struct list_head *resources)
 {
@@ -1715,6 +1724,8 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
        if (error)
                goto class_dev_reg_err;
 
+       pcibios_add_bus(b);
+
        /* Create legacy_io and legacy_mem files for this bus */
        pci_create_legacy_files(b);