]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / PM: Split device wakeup management routines
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Nov 2012 00:40:36 +0000 (01:40 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Nov 2012 23:15:17 +0000 (00:15 +0100)
commitdee8370cc87e505ef39567f0974e73d59e75d76b
treea8016fcb6edbdf2fbb01c6d50ded276eed626829
parentcd7bd02d319eb34fa33d1705cf63f64928643708
ACPI / PM: Split device wakeup management routines

Two device wakeup management routines in device_pm.c and sleep.c,
acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake(), take a
device pointer argument and use it to obtain the ACPI handle of the
corresponding ACPI namespace node.  That handle is then used to get
the address of the struct acpi_device object corresponding to the
struct device passed as the argument.

Unfortunately, that last operation may be costly, because it involves
taking the global ACPI namespace mutex, so it shouldn't be carried
out too often.  However, the callers of those routines usually call
them in a row with acpi_pm_device_sleep_state() which also takes that
mutex for the same reason, so it would be more efficient if they ran
acpi_bus_get_device() themselves to obtain a pointer to the struct
acpi_device object in question and then passed that pointer to the
appropriate PM routines.

To make that possible, split each of the PM routines mentioned above
in two parts, one taking a struct acpi_device pointer argument and
the other implementing the current interface for compatibility.

Additionally, change acpi_pm_device_run_wake() to actually return
an error code if there is an error while setting up runtime remote
wakeup for the device.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_pm.c
drivers/acpi/sleep.c
include/acpi/acpi_bus.h