Commit ed13febf authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / hotplug / PCI: Rework acpiphp_handle_to_bridge()

Using the hotplug context objects introduced previously rework the
ACPI-based PCI hotplug (ACPIPHP) core code to get to acpiphp_bridge
objects associated with hotplug bridges from those context objects
rather than from the global list of hotplug bridges.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 87831273
...@@ -454,18 +454,20 @@ static int detect_ejectable_slots(acpi_handle handle) ...@@ -454,18 +454,20 @@ static int detect_ejectable_slots(acpi_handle handle)
static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle) static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle)
{ {
struct acpiphp_bridge *bridge; struct acpiphp_context *context;
struct acpiphp_bridge *bridge = NULL;
mutex_lock(&bridge_mutex); mutex_lock(&acpiphp_context_lock);
list_for_each_entry(bridge, &bridge_list, list) context = acpiphp_get_context(handle);
if (bridge->handle == handle) { if (context) {
bridge = context->bridge;
if (bridge)
get_bridge(bridge); get_bridge(bridge);
mutex_unlock(&bridge_mutex);
return bridge;
}
mutex_unlock(&bridge_mutex);
return NULL; acpiphp_put_context(context);
}
mutex_unlock(&acpiphp_context_lock);
return bridge;
} }
static void cleanup_bridge(struct acpiphp_bridge *bridge) static void cleanup_bridge(struct acpiphp_bridge *bridge)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment