aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index c5ca3134513a..5fd585293e79 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1210,16 +1210,19 @@ static void __init pci_sort_breadthfirst_klist(void)
1210 struct klist_node *n; 1210 struct klist_node *n;
1211 struct device *dev; 1211 struct device *dev;
1212 struct pci_dev *pdev; 1212 struct pci_dev *pdev;
1213 struct klist *device_klist;
1213 1214
1214 spin_lock(&pci_bus_type.klist_devices.k_lock); 1215 device_klist = bus_get_device_klist(&pci_bus_type);
1215 list_for_each_safe(pos, tmp, &pci_bus_type.klist_devices.k_list) { 1216
1217 spin_lock(&device_klist->k_lock);
1218 list_for_each_safe(pos, tmp, &device_klist->k_list) {
1216 n = container_of(pos, struct klist_node, n_node); 1219 n = container_of(pos, struct klist_node, n_node);
1217 dev = container_of(n, struct device, knode_bus); 1220 dev = container_of(n, struct device, knode_bus);
1218 pdev = to_pci_dev(dev); 1221 pdev = to_pci_dev(dev);
1219 pci_insertion_sort_klist(pdev, &sorted_devices); 1222 pci_insertion_sort_klist(pdev, &sorted_devices);
1220 } 1223 }
1221 list_splice(&sorted_devices, &pci_bus_type.klist_devices.k_list); 1224 list_splice(&sorted_devices, &device_klist->k_list);
1222 spin_unlock(&pci_bus_type.klist_devices.k_lock); 1225 spin_unlock(&device_klist->k_lock);
1223} 1226}
1224 1227
1225static void __init pci_insertion_sort_devices(struct pci_dev *a, struct list_head *list) 1228static void __init pci_insertion_sort_devices(struct pci_dev *a, struct list_head *list)