summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorRafael J. Wysocki2013-07-13 23:27:24 +0200
committerRafael J. Wysocki2013-07-23 04:00:21 +0200
commitc8ebcf1ff91a8f64b09c4df0ee21ae80a953c39c (patch)
treef52cc3e0ee1c543089864d2e2cee7031f9b880f7 /drivers/pci/hotplug
parentACPI / hotplug / PCI: Rework acpiphp_handle_to_bridge() (diff)
downloadkernel-qcow2-linux-c8ebcf1ff91a8f64b09c4df0ee21ae80a953c39c.tar.gz
kernel-qcow2-linux-c8ebcf1ff91a8f64b09c4df0ee21ae80a953c39c.tar.xz
kernel-qcow2-linux-c8ebcf1ff91a8f64b09c4df0ee21ae80a953c39c.zip
ACPI / hotplug / PCI: Pass hotplug context objects to event handlers
Modify handle_hotplug_event() to pass the entire context object (instead of its fields individually) to work functions started by it. This change makes the subsequent consolidation of the event handling work functions a bit more straightforward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 6cfd8a684766..b5a98f4baa3a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -989,6 +989,7 @@ void acpiphp_check_host_bridge(acpi_handle handle)
static void _handle_hotplug_event_bridge(struct work_struct *work)
{
+ struct acpiphp_context *context;
struct acpiphp_bridge *bridge;
char objname[64];
struct acpi_buffer buffer = { .length = sizeof(objname),
@@ -1000,7 +1001,8 @@ static void _handle_hotplug_event_bridge(struct work_struct *work)
hp_work = container_of(work, struct acpi_hp_work, work);
handle = hp_work->handle;
type = hp_work->type;
- bridge = (struct acpiphp_bridge *)hp_work->context;
+ context = hp_work->context;
+ bridge = context->bridge;
acpi_scan_lock_acquire();
@@ -1105,18 +1107,18 @@ static void hotplug_event_func(acpi_handle handle, u32 type, void *context)
static void _handle_hotplug_event_func(struct work_struct *work)
{
+ struct acpiphp_context *context;
struct acpi_hp_work *hp_work;
- struct acpiphp_func *func;
hp_work = container_of(work, struct acpi_hp_work, work);
- func = hp_work->context;
+ context = hp_work->context;
acpi_scan_lock_acquire();
- hotplug_event_func(hp_work->handle, hp_work->type, func);
+ hotplug_event_func(hp_work->handle, hp_work->type, context->func);
acpi_scan_lock_release();
kfree(hp_work); /* allocated in handle_hotplug_event_func */
- put_bridge(func->slot->bridge);
+ put_bridge(context->func->slot->bridge);
}
/**
@@ -1137,11 +1139,9 @@ static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
if (context) {
if (context->bridge) {
get_bridge(context->bridge);
- data = context->bridge;
work_func = _handle_hotplug_event_bridge;
} else if (context->func) {
get_bridge(context->func->slot->bridge);
- data = context->func;
work_func = _handle_hotplug_event_func;
}
acpiphp_put_context(context);
@@ -1157,7 +1157,7 @@ static void handle_hotplug_event(acpi_handle handle, u32 type, void *data)
* don't deadlock on hotplug actions.
*/
if (work_func)
- alloc_acpi_hp_work(handle, type, data, work_func);
+ alloc_acpi_hp_work(handle, type, context, work_func);
}
/*