diff options
author | Rajesh Shah <rajesh.shah@intel.com> | 2005-04-28 00:25:49 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 21:52:40 -0700 |
commit | 6ef6f0e33c4645fc8d23201ad5a6a289b4303cbb (patch) | |
tree | ff7861a550b5eea24788ccc07ca0df5294f9067b /drivers/pci/bus.c | |
parent | e4ea9bb7e9f177e03a917b1f1213de0315f819ee (diff) | |
download | lwn-6ef6f0e33c4645fc8d23201ad5a6a289b4303cbb.tar.gz lwn-6ef6f0e33c4645fc8d23201ad5a6a289b4303cbb.zip |
[PATCH] acpi bridge hotadd: Link newly created pci child bus to its parent on creation
When a pci child bus is created, add it to the parent's children list
immediately rather than waiting till pci_bus_add_devices(). For hot-plug
bridges/devices, pci_bus_add_devices() may be called much later, after they
have been properly configured. In the meantime, this allows us to use the
normal pci bus search functions for the hot-plug bridges/buses.
Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index dbd33605cc10..fedae89d8f7d 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -121,10 +121,13 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus) * If there is an unattached subordinate bus, attach * it and then scan for unattached PCI devices. */ - if (dev->subordinate && list_empty(&dev->subordinate->node)) { - spin_lock(&pci_bus_lock); - list_add_tail(&dev->subordinate->node, &dev->bus->children); - spin_unlock(&pci_bus_lock); + if (dev->subordinate) { + if (list_empty(&dev->subordinate->node)) { + spin_lock(&pci_bus_lock); + list_add_tail(&dev->subordinate->node, + &dev->bus->children); + spin_unlock(&pci_bus_lock); + } pci_bus_add_devices(dev->subordinate); sysfs_create_link(&dev->subordinate->class_dev.kobj, &dev->dev.kobj, "bridge"); |