diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-07-07 06:08:27 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-07-07 06:08:27 -0400 |
commit | 717cb906bd43a9ac00631d600adda5c6546843a6 (patch) | |
tree | f41b250e9e0fa1e664f002fa9c4608d94527f2f2 /drivers/pci/remove.c | |
parent | 22f579c621e2f264e6d093b07d75f99bc97d5df2 (diff) | |
parent | c101f3136cc98a003d0d16be6fab7d0d950581a6 (diff) |
Merge ../linux-2.6/
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r-- | drivers/pci/remove.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 96f077f9a659..27a294b6965d 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c | |||
@@ -18,17 +18,21 @@ static void pci_free_resources(struct pci_dev *dev) | |||
18 | 18 | ||
19 | static void pci_destroy_dev(struct pci_dev *dev) | 19 | static void pci_destroy_dev(struct pci_dev *dev) |
20 | { | 20 | { |
21 | pci_proc_detach_device(dev); | 21 | if (!list_empty(&dev->global_list)) { |
22 | pci_remove_sysfs_dev_files(dev); | 22 | pci_proc_detach_device(dev); |
23 | device_unregister(&dev->dev); | 23 | pci_remove_sysfs_dev_files(dev); |
24 | device_unregister(&dev->dev); | ||
25 | spin_lock(&pci_bus_lock); | ||
26 | list_del(&dev->global_list); | ||
27 | dev->global_list.next = dev->global_list.prev = NULL; | ||
28 | spin_unlock(&pci_bus_lock); | ||
29 | } | ||
24 | 30 | ||
25 | /* Remove the device from the device lists, and prevent any further | 31 | /* Remove the device from the device lists, and prevent any further |
26 | * list accesses from this device */ | 32 | * list accesses from this device */ |
27 | spin_lock(&pci_bus_lock); | 33 | spin_lock(&pci_bus_lock); |
28 | list_del(&dev->bus_list); | 34 | list_del(&dev->bus_list); |
29 | list_del(&dev->global_list); | ||
30 | dev->bus_list.next = dev->bus_list.prev = NULL; | 35 | dev->bus_list.next = dev->bus_list.prev = NULL; |
31 | dev->global_list.next = dev->global_list.prev = NULL; | ||
32 | spin_unlock(&pci_bus_lock); | 36 | spin_unlock(&pci_bus_lock); |
33 | 37 | ||
34 | pci_free_resources(dev); | 38 | pci_free_resources(dev); |