diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-acpi.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 6fe0772e0e7d..7c3b18e78cee 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -293,19 +293,11 @@ static int acpi_dev_run_wake(struct device *phys_dev, bool enable) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | if (enable) { | 295 | if (enable) { |
296 | if (!dev->wakeup.run_wake_count++) { | 296 | acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0); |
297 | acpi_enable_wakeup_device_power(dev, ACPI_STATE_S0); | 297 | acpi_enable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number); |
298 | acpi_enable_gpe(dev->wakeup.gpe_device, | ||
299 | dev->wakeup.gpe_number); | ||
300 | } | ||
301 | } else if (dev->wakeup.run_wake_count > 0) { | ||
302 | if (!--dev->wakeup.run_wake_count) { | ||
303 | acpi_disable_gpe(dev->wakeup.gpe_device, | ||
304 | dev->wakeup.gpe_number); | ||
305 | acpi_disable_wakeup_device_power(dev); | ||
306 | } | ||
307 | } else { | 298 | } else { |
308 | error = -EALREADY; | 299 | acpi_disable_gpe(dev->wakeup.gpe_device, dev->wakeup.gpe_number); |
300 | acpi_disable_wakeup_device_power(dev); | ||
309 | } | 301 | } |
310 | 302 | ||
311 | return error; | 303 | return error; |