diff options
author | Len Brown <len.brown@intel.com> | 2009-09-19 06:06:59 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-09-19 06:06:59 +0200 |
commit | 71fd68e7d234f6b7d8407c8f486764d24f8411f4 (patch) | |
tree | 6dc2a4c356b4f454fc85d0c7cb019986f6f4993b /drivers/acpi/sleep.c | |
parent | Merge branch 'bugzilla-13002' into release (diff) | |
parent | Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/k... (diff) | |
download | linux-71fd68e7d234f6b7d8407c8f486764d24f8411f4.tar.xz linux-71fd68e7d234f6b7d8407c8f486764d24f8411f4.zip |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index e0a74097a978..a90afcc723ab 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -697,19 +697,25 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) { acpi_handle handle; struct acpi_device *adev; + int error; - if (!device_may_wakeup(dev)) + if (!device_can_wakeup(dev)) return -EINVAL; handle = DEVICE_ACPI_HANDLE(dev); if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { - printk(KERN_DEBUG "ACPI handle has no context!\n"); + dev_dbg(dev, "ACPI handle has no context in %s!\n", __func__); return -ENODEV; } - return enable ? + error = enable ? acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : acpi_disable_wakeup_device_power(adev); + if (!error) + dev_info(dev, "wake-up capability %s by ACPI\n", + enable ? "enabled" : "disabled"); + + return error; } #endif |