diff options
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 7217f4283ce8..504f19b2af45 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -20,8 +20,6 @@ | |||
20 | LIST_HEAD(pci_root_buses); | 20 | LIST_HEAD(pci_root_buses); |
21 | EXPORT_SYMBOL(pci_root_buses); | 21 | EXPORT_SYMBOL(pci_root_buses); |
22 | 22 | ||
23 | LIST_HEAD(pci_devices); | ||
24 | |||
25 | 23 | ||
26 | static int find_anything(struct device *dev, void *data) | 24 | static int find_anything(struct device *dev, void *data) |
27 | { | 25 | { |
@@ -860,7 +858,6 @@ struct pci_dev *alloc_pci_dev(void) | |||
860 | if (!dev) | 858 | if (!dev) |
861 | return NULL; | 859 | return NULL; |
862 | 860 | ||
863 | INIT_LIST_HEAD(&dev->global_list); | ||
864 | INIT_LIST_HEAD(&dev->bus_list); | 861 | INIT_LIST_HEAD(&dev->bus_list); |
865 | 862 | ||
866 | pci_msi_init_pci_dev(dev); | 863 | pci_msi_init_pci_dev(dev); |
@@ -957,7 +954,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus) | |||
957 | * Add the device to our list of discovered devices | 954 | * Add the device to our list of discovered devices |
958 | * and the bus list for fixup functions, etc. | 955 | * and the bus list for fixup functions, etc. |
959 | */ | 956 | */ |
960 | INIT_LIST_HEAD(&dev->global_list); | ||
961 | down_write(&pci_bus_sem); | 957 | down_write(&pci_bus_sem); |
962 | list_add_tail(&dev->bus_list, &bus->devices); | 958 | list_add_tail(&dev->bus_list, &bus->devices); |
963 | up_write(&pci_bus_sem); | 959 | up_write(&pci_bus_sem); |
@@ -1186,7 +1182,7 @@ static void __init pci_insertion_sort_klist(struct pci_dev *a, struct list_head | |||
1186 | list_move_tail(&a->dev.knode_bus.n_node, list); | 1182 | list_move_tail(&a->dev.knode_bus.n_node, list); |
1187 | } | 1183 | } |
1188 | 1184 | ||
1189 | static void __init pci_sort_breadthfirst_klist(void) | 1185 | void __init pci_sort_breadthfirst(void) |
1190 | { | 1186 | { |
1191 | LIST_HEAD(sorted_devices); | 1187 | LIST_HEAD(sorted_devices); |
1192 | struct list_head *pos, *tmp; | 1188 | struct list_head *pos, *tmp; |
@@ -1207,36 +1203,3 @@ static void __init pci_sort_breadthfirst_klist(void) | |||
1207 | list_splice(&sorted_devices, &device_klist->k_list); | 1203 | list_splice(&sorted_devices, &device_klist->k_list); |
1208 | spin_unlock(&device_klist->k_lock); | 1204 | spin_unlock(&device_klist->k_lock); |
1209 | } | 1205 | } |
1210 | |||
1211 | static void __init pci_insertion_sort_devices(struct pci_dev *a, struct list_head *list) | ||
1212 | { | ||
1213 | struct pci_dev *b; | ||
1214 | |||
1215 | list_for_each_entry(b, list, global_list) { | ||
1216 | if (pci_sort_bf_cmp(a, b) <= 0) { | ||
1217 | list_move_tail(&a->global_list, &b->global_list); | ||
1218 | return; | ||
1219 | } | ||
1220 | } | ||
1221 | list_move_tail(&a->global_list, list); | ||
1222 | } | ||
1223 | |||
1224 | static void __init pci_sort_breadthfirst_devices(void) | ||
1225 | { | ||
1226 | LIST_HEAD(sorted_devices); | ||
1227 | struct pci_dev *dev, *tmp; | ||
1228 | |||
1229 | down_write(&pci_bus_sem); | ||
1230 | list_for_each_entry_safe(dev, tmp, &pci_devices, global_list) { | ||
1231 | pci_insertion_sort_devices(dev, &sorted_devices); | ||
1232 | } | ||
1233 | list_splice(&sorted_devices, &pci_devices); | ||
1234 | up_write(&pci_bus_sem); | ||
1235 | } | ||
1236 | |||
1237 | void __init pci_sort_breadthfirst(void) | ||
1238 | { | ||
1239 | pci_sort_breadthfirst_devices(); | ||
1240 | pci_sort_breadthfirst_klist(); | ||
1241 | } | ||
1242 | |||