diff options
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 5b7c52e4a00f..aaa1af55e280 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -664,18 +664,9 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | |||
664 | return -ENODEV; | 664 | return -ENODEV; |
665 | } | 665 | } |
666 | 666 | ||
667 | if (enable) { | 667 | error = enable ? |
668 | error = acpi_enable_wakeup_device_power(adev, | 668 | acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : |
669 | acpi_target_sleep_state); | 669 | acpi_disable_wakeup_device_power(adev); |
670 | if (!error) | ||
671 | acpi_enable_gpe(adev->wakeup.gpe_device, | ||
672 | adev->wakeup.gpe_number, | ||
673 | ACPI_GPE_TYPE_WAKE); | ||
674 | } else { | ||
675 | acpi_disable_gpe(adev->wakeup.gpe_device, adev->wakeup.gpe_number, | ||
676 | ACPI_GPE_TYPE_WAKE); | ||
677 | error = acpi_disable_wakeup_device_power(adev); | ||
678 | } | ||
679 | if (!error) | 670 | if (!error) |
680 | dev_info(dev, "wake-up capability %s by ACPI\n", | 671 | dev_info(dev, "wake-up capability %s by ACPI\n", |
681 | enable ? "enabled" : "disabled"); | 672 | enable ? "enabled" : "disabled"); |