lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Resend][PATCH 2/5][RFT] ACPI / hotplug: Introduce acpi_install_hotplug_notify_handler()
Date
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Introduce a helper routine for installing acpi_hotplug_notify_cb()
as an ACPI notify handler for the given ACPI namespace node and make
acpi_scan_init_hotplug() use it.

This is to make subsequent changes easier to follow.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/scan.c | 15 +++++++++++++--
include/acpi/acpi_bus.h | 2 ++
2 files changed, 15 insertions(+), 2 deletions(-)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -523,6 +523,18 @@ static void acpi_hotplug_notify_cb(acpi_
acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
}

+void acpi_install_hotplug_notify_handler(acpi_handle handle, void *data)
+{
+ acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+ acpi_hotplug_notify_cb, data);
+}
+
+void acpi_remove_hotplug_notify_handler(acpi_handle handle)
+{
+ acpi_remove_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+ acpi_hotplug_notify_cb);
+}
+
static ssize_t real_power_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -1961,8 +1973,7 @@ static void acpi_scan_init_hotplug(acpi_
list_for_each_entry(hwid, &pnp.ids, list) {
handler = acpi_scan_match_handler(hwid->id, NULL);
if (handler) {
- acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
- acpi_hotplug_notify_cb, handler);
+ acpi_install_hotplug_notify_handler(handle, handler);
break;
}
}
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -434,6 +434,8 @@ static inline bool acpi_device_enumerate
typedef void (*acpi_hp_callback)(void *data, u32 src);

acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src);
+void acpi_install_hotplug_notify_handler(acpi_handle handle, void *data);
+void acpi_remove_hotplug_notify_handler(acpi_handle handle);

/**
* module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver


\
 
 \ /
  Last update: 2014-01-29 02:21    [W:0.487 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site