提交 72925760 编写于 作者: K Konstantin Karasyov 提交者: Len Brown
上级 255f0385
......@@ -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)
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册