diff options
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 602d153c7055..08043f9c1dd5 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -369,20 +369,6 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, | |||
369 | return AE_OK; | 369 | return AE_OK; |
370 | } | 370 | } |
371 | 371 | ||
372 | static struct acpiphp_bridge *acpiphp_dev_to_bridge(struct acpi_device *adev) | ||
373 | { | ||
374 | struct acpiphp_bridge *bridge = NULL; | ||
375 | |||
376 | acpi_lock_hp_context(); | ||
377 | if (adev->hp) { | ||
378 | bridge = to_acpiphp_root_context(adev->hp)->root_bridge; | ||
379 | if (bridge) | ||
380 | get_bridge(bridge); | ||
381 | } | ||
382 | acpi_unlock_hp_context(); | ||
383 | return bridge; | ||
384 | } | ||
385 | |||
386 | static void cleanup_bridge(struct acpiphp_bridge *bridge) | 372 | static void cleanup_bridge(struct acpiphp_bridge *bridge) |
387 | { | 373 | { |
388 | struct acpiphp_slot *slot; | 374 | struct acpiphp_slot *slot; |
@@ -753,9 +739,15 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus) | |||
753 | 739 | ||
754 | void acpiphp_check_host_bridge(struct acpi_device *adev) | 740 | void acpiphp_check_host_bridge(struct acpi_device *adev) |
755 | { | 741 | { |
756 | struct acpiphp_bridge *bridge; | 742 | struct acpiphp_bridge *bridge = NULL; |
757 | 743 | ||
758 | bridge = acpiphp_dev_to_bridge(adev); | 744 | acpi_lock_hp_context(); |
745 | if (adev->hp) { | ||
746 | bridge = to_acpiphp_root_context(adev->hp)->root_bridge; | ||
747 | if (bridge) | ||
748 | get_bridge(bridge); | ||
749 | } | ||
750 | acpi_unlock_hp_context(); | ||
759 | if (bridge) { | 751 | if (bridge) { |
760 | pci_lock_rescan_remove(); | 752 | pci_lock_rescan_remove(); |
761 | 753 | ||