aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-03 18:43:17 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-05 11:41:26 -0500
commite525506fcb67a9bbd94f01eac84af802139004eb (patch)
tree505ec664227aa70fc7fa3a7f21bcfe45983ca979 /drivers/acpi/scan.c
parent78ea4639a7647f2fcc957c3a532bde49df9895c7 (diff)
ACPI / hotplug / PCI: Define hotplug context lock in the core
Subsequent changes will require the ACPI core to acquire the lock protecting the ACPIPHP hotplug contexts, so move the definition of the lock to the core and change its name to be more generic. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 59eba29a6066..d64a5826ef35 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -41,6 +41,7 @@ static DEFINE_MUTEX(acpi_scan_lock);
41static LIST_HEAD(acpi_scan_handlers_list); 41static LIST_HEAD(acpi_scan_handlers_list);
42DEFINE_MUTEX(acpi_device_lock); 42DEFINE_MUTEX(acpi_device_lock);
43LIST_HEAD(acpi_wakeup_device_list); 43LIST_HEAD(acpi_wakeup_device_list);
44static DEFINE_MUTEX(acpi_hp_context_lock);
44 45
45struct acpi_device_bus_id{ 46struct acpi_device_bus_id{
46 char bus_id[15]; 47 char bus_id[15];
@@ -60,6 +61,16 @@ void acpi_scan_lock_release(void)
60} 61}
61EXPORT_SYMBOL_GPL(acpi_scan_lock_release); 62EXPORT_SYMBOL_GPL(acpi_scan_lock_release);
62 63
64void acpi_lock_hp_context(void)
65{
66 mutex_lock(&acpi_hp_context_lock);
67}
68
69void acpi_unlock_hp_context(void)
70{
71 mutex_unlock(&acpi_hp_context_lock);
72}
73
63int acpi_scan_add_handler(struct acpi_scan_handler *handler) 74int acpi_scan_add_handler(struct acpi_scan_handler *handler)
64{ 75{
65 if (!handler || !handler->attach) 76 if (!handler || !handler->attach)