aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 18c9e54990ee..e4b7f2bc94df 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -323,9 +323,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
323 INIT_LIST_HEAD(&slot->funcs); 323 INIT_LIST_HEAD(&slot->funcs);
324 mutex_init(&slot->crit_sect); 324 mutex_init(&slot->crit_sect);
325 325
326 mutex_lock(&bridge_mutex);
327 list_add_tail(&slot->node, &bridge->slots); 326 list_add_tail(&slot->node, &bridge->slots);
328 mutex_unlock(&bridge_mutex);
329 327
330 /* Register slots for ejectable funtions only. */ 328 /* Register slots for ejectable funtions only. */
331 if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) { 329 if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) {
@@ -355,9 +353,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
355 353
356 slot_found: 354 slot_found:
357 newfunc->slot = slot; 355 newfunc->slot = slot;
358 mutex_lock(&bridge_mutex);
359 list_add_tail(&newfunc->sibling, &slot->funcs); 356 list_add_tail(&newfunc->sibling, &slot->funcs);
360 mutex_unlock(&bridge_mutex);
361 357
362 if (pci_bus_read_dev_vendor_id(pbus, PCI_DEVFN(device, function), 358 if (pci_bus_read_dev_vendor_id(pbus, PCI_DEVFN(device, function),
363 &val, 60*1000)) 359 &val, 60*1000))
@@ -1025,17 +1021,21 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
1025/* Destroy hotplug slots associated with the PCI bus */ 1021/* Destroy hotplug slots associated with the PCI bus */
1026void acpiphp_remove_slots(struct pci_bus *bus) 1022void acpiphp_remove_slots(struct pci_bus *bus)
1027{ 1023{
1028 struct acpiphp_bridge *bridge, *tmp; 1024 struct acpiphp_bridge *bridge;
1029 1025
1030 if (acpiphp_disabled) 1026 if (acpiphp_disabled)
1031 return; 1027 return;
1032 1028
1033 list_for_each_entry_safe(bridge, tmp, &bridge_list, list) 1029 mutex_lock(&bridge_mutex);
1030 list_for_each_entry(bridge, &bridge_list, list)
1034 if (bridge->pci_bus == bus) { 1031 if (bridge->pci_bus == bus) {
1032 mutex_unlock(&bridge_mutex);
1035 cleanup_bridge(bridge); 1033 cleanup_bridge(bridge);
1036 put_bridge(bridge); 1034 put_bridge(bridge);
1037 break; 1035 return;
1038 } 1036 }
1037
1038 mutex_unlock(&bridge_mutex);
1039} 1039}
1040 1040
1041/** 1041/**