diff options
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index d708358326e5..529d9d7727b0 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -84,10 +84,7 @@ int pci_bus_add_device(struct pci_dev *dev) | |||
84 | if (retval) | 84 | if (retval) |
85 | return retval; | 85 | return retval; |
86 | 86 | ||
87 | down_write(&pci_bus_sem); | 87 | dev->is_added = 1; |
88 | list_add_tail(&dev->global_list, &pci_devices); | ||
89 | up_write(&pci_bus_sem); | ||
90 | |||
91 | pci_proc_attach_device(dev); | 88 | pci_proc_attach_device(dev); |
92 | pci_create_sysfs_dev_files(dev); | 89 | pci_create_sysfs_dev_files(dev); |
93 | return 0; | 90 | return 0; |
@@ -112,11 +109,8 @@ void pci_bus_add_devices(struct pci_bus *bus) | |||
112 | int retval; | 109 | int retval; |
113 | 110 | ||
114 | list_for_each_entry(dev, &bus->devices, bus_list) { | 111 | list_for_each_entry(dev, &bus->devices, bus_list) { |
115 | /* | 112 | /* Skip already-added devices */ |
116 | * Skip already-present devices (which are on the | 113 | if (dev->is_added) |
117 | * global device list.) | ||
118 | */ | ||
119 | if (!list_empty(&dev->global_list)) | ||
120 | continue; | 114 | continue; |
121 | retval = pci_bus_add_device(dev); | 115 | retval = pci_bus_add_device(dev); |
122 | if (retval) | 116 | if (retval) |
@@ -124,8 +118,7 @@ void pci_bus_add_devices(struct pci_bus *bus) | |||
124 | } | 118 | } |
125 | 119 | ||
126 | list_for_each_entry(dev, &bus->devices, bus_list) { | 120 | list_for_each_entry(dev, &bus->devices, bus_list) { |
127 | 121 | BUG_ON(!dev->is_added); | |
128 | BUG_ON(list_empty(&dev->global_list)); | ||
129 | 122 | ||
130 | /* | 123 | /* |
131 | * If there is an unattached subordinate bus, attach | 124 | * If there is an unattached subordinate bus, attach |