Skip to content

Commit

Permalink
ACPI: fix S3 fan resume issue
Browse files Browse the repository at this point in the history
http://bugzilla.kernel.org/show_bug.cgi?id=7570#c14

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Konstantin Karasyov authored and Len Brown committed Feb 21, 2007
1 parent 255f038 commit 7292576
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 7292576

Please sign in to comment.