aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index be12fbfcae10..e98018b43e2a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -875,21 +875,17 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
875 put_bridge(bridge); 875 put_bridge(bridge);
876} 876}
877 877
878static void hotplug_event_work(struct work_struct *work) 878static void hotplug_event_work(void *data, u32 type)
879{ 879{
880 struct acpiphp_context *context; 880 struct acpiphp_context *context = data;
881 struct acpi_hp_work *hp_work; 881 acpi_handle handle = context->handle;
882 882
883 hp_work = container_of(work, struct acpi_hp_work, work);
884 context = hp_work->context;
885 acpi_scan_lock_acquire(); 883 acpi_scan_lock_acquire();
886 884
887 hotplug_event(hp_work->handle, hp_work->type, context); 885 hotplug_event(handle, type, context);
888 886
889 acpi_scan_lock_release(); 887 acpi_scan_lock_release();
890 acpi_evaluate_hotplug_ost(hp_work->handle, hp_work->type, 888 acpi_evaluate_hotplug_ost(handle, type, ACPI_OST_SC_SUCCESS, NULL);
891 ACPI_OST_SC_SUCCESS, NULL);
892 kfree(hp_work); /* allocated in handle_hotplug_event() */
893 put_bridge(context->func.parent); 889 put_bridge(context->func.parent);
894} 890}
895 891
@@ -940,10 +936,10 @@ static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
940 936
941 mutex_lock(&acpiphp_context_lock); 937 mutex_lock(&acpiphp_context_lock);
942 context = acpiphp_get_context(handle); 938 context = acpiphp_get_context(handle);
943 if (context) { 939 if (context && !WARN_ON(context->handle != handle)) {
944 get_bridge(context->func.parent); 940 get_bridge(context->func.parent);
945 acpiphp_put_context(context); 941 acpiphp_put_context(context);
946 alloc_acpi_hp_work(handle, type, context, hotplug_event_work); 942 acpi_hotplug_execute(hotplug_event_work, context, type);
947 mutex_unlock(&acpiphp_context_lock); 943 mutex_unlock(&acpiphp_context_lock);
948 return; 944 return;
949 } 945 }