diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-14 14:56:56 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-20 21:47:00 -0700 |
commit | 8a1bc9013a03d41a0e36ee413bb6f97281b30bd1 (patch) | |
tree | 83c01850e1779e37be1d9db0f87436b09b89f3fe /drivers/pci/remove.c | |
parent | 70308923d317f2ad4973c30d90bb48ae38761317 (diff) | |
download | linux-8a1bc9013a03d41a0e36ee413bb6f97281b30bd1.tar.gz linux-8a1bc9013a03d41a0e36ee413bb6f97281b30bd1.tar.bz2 linux-8a1bc9013a03d41a0e36ee413bb6f97281b30bd1.zip |
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/remove.c')
-rw-r--r-- | drivers/pci/remove.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 9684e1bde277..d3c77cbe3279 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -18,13 +18,11 @@ static void pci_free_resources(struct pci_dev *dev) static void pci_stop_dev(struct pci_dev *dev) { - if (!dev->global_list.next) - return; - - if (!list_empty(&dev->global_list)) { + if (dev->is_added) { pci_proc_detach_device(dev); pci_remove_sysfs_dev_files(dev); device_unregister(&dev->dev); + dev->is_added = 0; down_write(&pci_bus_sem); list_del(&dev->global_list); dev->global_list.next = dev->global_list.prev = NULL; |