diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-15 01:56:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-21 08:47:00 +0400 |
commit | 8a1bc9013a03d41a0e36ee413bb6f97281b30bd1 (patch) | |
tree | 83c01850e1779e37be1d9db0f87436b09b89f3fe /drivers/pci/bus.c | |
parent | 70308923d317f2ad4973c30d90bb48ae38761317 (diff) | |
download | linux-8a1bc9013a03d41a0e36ee413bb6f97281b30bd1.tar.xz |
PCI: add is_added flag to struct pci_dev
This lets us check if the device is really added to the driver core or
not, which is what we need when walking some of the bus lists. The flag
is there in anticipation of getting rid of the other PCI device list,
which is what we used to check in this situation.
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, 4 insertions, 7 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index d708358326e5..e1c079aa0e82 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -84,6 +84,7 @@ int pci_bus_add_device(struct pci_dev *dev) if (retval) return retval; + dev->is_added = 1; down_write(&pci_bus_sem); list_add_tail(&dev->global_list, &pci_devices); up_write(&pci_bus_sem); @@ -112,11 +113,8 @@ void pci_bus_add_devices(struct pci_bus *bus) int retval; list_for_each_entry(dev, &bus->devices, bus_list) { - /* - * Skip already-present devices (which are on the - * global device list.) - */ - if (!list_empty(&dev->global_list)) + /* Skip already-added devices */ + if (dev->is_added) continue; retval = pci_bus_add_device(dev); if (retval) @@ -124,8 +122,7 @@ void pci_bus_add_devices(struct pci_bus *bus) } list_for_each_entry(dev, &bus->devices, bus_list) { - - BUG_ON(list_empty(&dev->global_list)); + BUG_ON(!dev->is_added); /* * If there is an unattached subordinate bus, attach |