Commit cb2ebc59 authored by Len Brown's avatar Len Brown

Pull bugzilla-7570 into release branch

parents 3dfb7379 72925760
...@@ -436,8 +436,6 @@ int acpi_power_transition(struct acpi_device *device, int state) ...@@ -436,8 +436,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
cl = &device->power.states[device->power.state].resources; cl = &device->power.states[device->power.state].resources;
tl = &device->power.states[state].resources; tl = &device->power.states[state].resources;
device->power.state = ACPI_STATE_UNKNOWN;
if (!cl->count && !tl->count) { if (!cl->count && !tl->count) {
result = -ENODEV; result = -ENODEV;
goto end; goto end;
...@@ -468,12 +466,15 @@ int acpi_power_transition(struct acpi_device *device, int state) ...@@ -468,12 +466,15 @@ int acpi_power_transition(struct acpi_device *device, int state)
goto end; goto end;
} }
/* We shouldn't change the state till all above operations succeed */ end:
device->power.state = state; if (result) {
end: device->power.state = ACPI_STATE_UNKNOWN;
if (result)
printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n",
device->pnp.bus_id, state); device->pnp.bus_id, state);
} else {
/* We shouldn't change the state till all above operations succeed */
device->power.state = state;
}
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment