diff options
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 79d33d908b5a..3bde594a9979 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -745,9 +745,18 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | |||
745 | return -ENODEV; | 745 | return -ENODEV; |
746 | } | 746 | } |
747 | 747 | ||
748 | error = enable ? | 748 | if (enable) { |
749 | acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : | 749 | error = acpi_enable_wakeup_device_power(adev, |
750 | acpi_disable_wakeup_device_power(adev); | 750 | acpi_target_sleep_state); |
751 | if (!error) | ||
752 | acpi_enable_gpe(adev->wakeup.gpe_device, | ||
753 | adev->wakeup.gpe_number, | ||
754 | ACPI_GPE_TYPE_WAKE); | ||
755 | } else { | ||
756 | acpi_disable_gpe(adev->wakeup.gpe_device, adev->wakeup.gpe_number, | ||
757 | ACPI_GPE_TYPE_WAKE); | ||
758 | error = acpi_disable_wakeup_device_power(adev); | ||
759 | } | ||
751 | if (!error) | 760 | if (!error) |
752 | dev_info(dev, "wake-up capability %s by ACPI\n", | 761 | dev_info(dev, "wake-up capability %s by ACPI\n", |
753 | enable ? "enabled" : "disabled"); | 762 | enable ? "enabled" : "disabled"); |