aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 9342c848db29..a3e4705dd8f0 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -705,9 +705,10 @@ cleanup_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
705 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, (u32)1, 705 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, (u32)1,
706 cleanup_p2p_bridge, NULL, NULL); 706 cleanup_p2p_bridge, NULL, NULL);
707 707
708 if (!(bridge = acpiphp_handle_to_bridge(handle))) 708 bridge = acpiphp_handle_to_bridge(handle);
709 return AE_OK; 709 if (bridge)
710 cleanup_bridge(bridge); 710 cleanup_bridge(bridge);
711
711 return AE_OK; 712 return AE_OK;
712} 713}
713 714
@@ -720,9 +721,19 @@ static void remove_bridge(acpi_handle handle)
720 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 721 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
721 (u32)1, cleanup_p2p_bridge, NULL, NULL); 722 (u32)1, cleanup_p2p_bridge, NULL, NULL);
722 723
724 /*
725 * On root bridges with hotplug slots directly underneath (ie,
726 * no p2p bridge inbetween), we call cleanup_bridge().
727 *
728 * The else clause cleans up root bridges that either had no
729 * hotplug slots at all, or had a p2p bridge underneath.
730 */
723 bridge = acpiphp_handle_to_bridge(handle); 731 bridge = acpiphp_handle_to_bridge(handle);
724 if (bridge) 732 if (bridge)
725 cleanup_bridge(bridge); 733 cleanup_bridge(bridge);
734 else
735 acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
736 handle_hotplug_event_bridge);
726} 737}
727 738
728static struct pci_dev * get_apic_pci_info(acpi_handle handle) 739static struct pci_dev * get_apic_pci_info(acpi_handle handle)