diff options
author | Len Brown <len.brown@intel.com> | 2007-03-10 07:18:46 +0300 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-03-10 07:18:46 +0300 |
commit | cb2ebc59ff52cee770cfd6ba5f23a6cc3c214648 (patch) | |
tree | d9ac06bd2cc92efc618cdfcce4a6142c9e0a00d5 | |
parent | 3dfb737998c265d3c8a15b931dc4d72335ab8255 (diff) | |
parent | 7292576043666ff39946dee14641fe719ba8c7e8 (diff) | |
download | linux-cb2ebc59ff52cee770cfd6ba5f23a6cc3c214648.tar.xz |
Pull bugzilla-7570 into release branch
-rw-r--r-- | drivers/acpi/power.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 1ef338545dfe..547eee7537bc 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -436,8 +436,6 @@ int acpi_power_transition(struct acpi_device *device, int state) cl = &device->power.states[device->power.state].resources; tl = &device->power.states[state].resources; - device->power.state = ACPI_STATE_UNKNOWN; - if (!cl->count && !tl->count) { result = -ENODEV; goto end; @@ -468,12 +466,15 @@ int acpi_power_transition(struct acpi_device *device, int state) goto end; } - /* We shouldn't change the state till all above operations succeed */ - device->power.state = state; - end: - if (result) + end: + if (result) { + device->power.state = ACPI_STATE_UNKNOWN; printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", device->pnp.bus_id, state); + } else { + /* We shouldn't change the state till all above operations succeed */ + device->power.state = state; + } return result; } |