summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/osl.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-17 08:47:14 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-17 08:47:14 -0400
commit6621c5a69a1dac50852ef09d5cf33154a174805a (patch)
tree88f4ff7d73006abcef64f9793daadda9d5034a32 /drivers/acpi/osl.c
parentd983f93328041f85e884a586810a67528ae59945 (diff)
parentd901188f002104905a7845298e1a7dc94189007a (diff)
Merge branch 'acpi-hotplug'
* acpi-hotplug: ACPI / hotplug: Rework deferred execution of acpi_device_hotplug() ACPI / dock: Update copyright notice ACPI / dock: Drop remove_dock_dependent_devices() ACPI / dock: Drop struct acpi_dock_ops and all code related to it ACPI / ATA: Add hotplug contexts to ACPI companions of SATA devices ACPI / dock: Add .uevent() callback to struct acpi_hotplug_context ACPI / dock: Use callback pointers from devices' ACPI hotplug contexts ACPI / dock: Use ACPI device object pointers instead of ACPI handles ACPI / hotplug: Add .fixup() callback to struct acpi_hotplug_context ACPI / hotplug / PCI: Do not clear event callback pointer for docks ACPI / dock: Associate dock platform devices with ACPI device objects ACPI / dock: Pass ACPI device pointer to acpi_device_is_battery() ACPI / dock: Dispatch dock notifications from the global notify handler
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r--drivers/acpi/osl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index fc1aa7909690..afb4be566940 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1168,8 +1168,7 @@ void acpi_os_wait_events_complete(void)
1168 1168
1169struct acpi_hp_work { 1169struct acpi_hp_work {
1170 struct work_struct work; 1170 struct work_struct work;
1171 acpi_hp_callback func; 1171 struct acpi_device *adev;
1172 void *data;
1173 u32 src; 1172 u32 src;
1174}; 1173};
1175 1174
@@ -1178,25 +1177,24 @@ static void acpi_hotplug_work_fn(struct work_struct *work)
1178 struct acpi_hp_work *hpw = container_of(work, struct acpi_hp_work, work); 1177 struct acpi_hp_work *hpw = container_of(work, struct acpi_hp_work, work);
1179 1178
1180 acpi_os_wait_events_complete(); 1179 acpi_os_wait_events_complete();
1181 hpw->func(hpw->data, hpw->src); 1180 acpi_device_hotplug(hpw->adev, hpw->src);
1182 kfree(hpw); 1181 kfree(hpw);
1183} 1182}
1184 1183
1185acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src) 1184acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src)
1186{ 1185{
1187 struct acpi_hp_work *hpw; 1186 struct acpi_hp_work *hpw;
1188 1187
1189 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 1188 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
1190 "Scheduling function [%p(%p, %u)] for deferred execution.\n", 1189 "Scheduling hotplug event (%p, %u) for deferred execution.\n",
1191 func, data, src)); 1190 adev, src));
1192 1191
1193 hpw = kmalloc(sizeof(*hpw), GFP_KERNEL); 1192 hpw = kmalloc(sizeof(*hpw), GFP_KERNEL);
1194 if (!hpw) 1193 if (!hpw)
1195 return AE_NO_MEMORY; 1194 return AE_NO_MEMORY;
1196 1195
1197 INIT_WORK(&hpw->work, acpi_hotplug_work_fn); 1196 INIT_WORK(&hpw->work, acpi_hotplug_work_fn);
1198 hpw->func = func; 1197 hpw->adev = adev;
1199 hpw->data = data;
1200 hpw->src = src; 1198 hpw->src = src;
1201 /* 1199 /*
1202 * We can't run hotplug code in kacpid_wq/kacpid_notify_wq etc., because 1200 * We can't run hotplug code in kacpid_wq/kacpid_notify_wq etc., because