diff options
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index a5a372222d69..e6a2a9fc7f0a 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -130,11 +130,16 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) | |||
130 | #ifdef CONFIG_ACPI_SLEEP | 130 | #ifdef CONFIG_ACPI_SLEEP |
131 | static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) | 131 | static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) |
132 | { | 132 | { |
133 | return acpi_bus_set_power((acpi_handle) dev->data, | 133 | int power_state; |
134 | acpi_pm_device_sleep_state(&dev->dev, | 134 | |
135 | device_may_wakeup | 135 | power_state = acpi_pm_device_sleep_state(&dev->dev, |
136 | (&dev->dev), | 136 | device_may_wakeup(&dev->dev), |
137 | NULL)); | 137 | NULL); |
138 | if (power_state < 0) | ||
139 | power_state = (state.event == PM_EVENT_ON) ? | ||
140 | ACPI_STATE_D0 : ACPI_STATE_D3; | ||
141 | |||
142 | return acpi_bus_set_power((acpi_handle) dev->data, power_state); | ||
138 | } | 143 | } |
139 | 144 | ||
140 | static int pnpacpi_resume(struct pnp_dev *dev) | 145 | static int pnpacpi_resume(struct pnp_dev *dev) |