diff options
| -rw-r--r-- | drivers/acpi/button.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/scan.c | 1 | ||||
| -rw-r--r-- | drivers/pci/pci-acpi.c | 16 | ||||
| -rw-r--r-- | include/acpi/acpi_bus.h | 1 |
4 files changed, 4 insertions, 16 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 76bbb78a5ad9..e643a0936dc4 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
| @@ -430,7 +430,6 @@ static int acpi_button_add(struct acpi_device *device) | |||
| 430 | /* Button's GPE is run-wake GPE */ | 430 | /* Button's GPE is run-wake GPE */ |
| 431 | acpi_enable_gpe(device->wakeup.gpe_device, | 431 | acpi_enable_gpe(device->wakeup.gpe_device, |
| 432 | device->wakeup.gpe_number); | 432 | device->wakeup.gpe_number); |
| 433 | device->wakeup.run_wake_count++; | ||
| 434 | device_set_wakeup_enable(&device->dev, true); | 433 | device_set_wakeup_enable(&device->dev, true); |
| 435 | } | 434 | } |
| 436 | 435 | ||
| @@ -453,7 +452,6 @@ static int acpi_button_remove(struct acpi_device *device, int type) | |||
| 453 | if (device->wakeup.flags.valid) { | 452 | if (device->wakeup.flags.valid) { |
| 454 | acpi_disable_gpe(device->wakeup.gpe_device, | 453 | acpi_disable_gpe(device->wakeup.gpe_device, |
| 455 | device->wakeup.gpe_number); | 454 | device->wakeup.gpe_number); |
| 456 | device->wakeup.run_wake_count--; | ||
| 457 | device_set_wakeup_enable(&device->dev, false); | 455 | device_set_wakeup_enable(&device->dev, false); |
| 458 | } | 456 | } |
| 459 | 457 | ||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index b99e62494607..b136c9c1e531 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -797,7 +797,6 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device) | |||
| 797 | acpi_status status; | 797 | acpi_status status; |
| 798 | acpi_event_status event_status; | 798 | acpi_event_status event_status; |
| 799 | 799 | ||
| 800 | device->wakeup.run_wake_count = 0; | ||
| 801 | device->wakeup.flags.notifier_present = 0; | 800 | device->wakeup.flags.notifier_present = 0; |
| 802 | 801 | ||
| 803 | /* Power button, Lid switch always enable wakeup */ | 802 | /* Power button, Lid switch always enable wakeup */ |
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; |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 78ca429929f7..f50ebb9bc53b 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -250,7 +250,6 @@ struct acpi_device_wakeup { | |||
| 250 | struct acpi_handle_list resources; | 250 | struct acpi_handle_list resources; |
| 251 | struct acpi_device_wakeup_flags flags; | 251 | struct acpi_device_wakeup_flags flags; |
| 252 | int prepare_count; | 252 | int prepare_count; |
| 253 | int run_wake_count; | ||
| 254 | }; | 253 | }; |
| 255 | 254 | ||
| 256 | /* Device */ | 255 | /* Device */ |
