diff options
author | Len Brown <len.brown@intel.com> | 2009-09-19 00:06:59 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-09-19 00:06:59 -0400 |
commit | 71fd68e7d234f6b7d8407c8f486764d24f8411f4 (patch) | |
tree | 6dc2a4c356b4f454fc85d0c7cb019986f6f4993b /drivers/acpi/sleep.c | |
parent | 8ff0e082f0833d32c7523a6cd72b6cf6a2142ce8 (diff) | |
parent | 78f28b7c555359c67c2a0d23f7436e915329421e (diff) |
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 e0a74097a97..a90afcc723a 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 |