Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350931
b: refs/heads/master
c: a236780
h: refs/heads/master
i:
  350929: e87ef51
  350927: 06f81bc
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 22, 2013
1 parent dc2dcc9 commit 6171ea8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d79beb39922e41083e8bbbb3de084a6ca958e25f
refs/heads/master: a2367807b8d2c0aca5afb92fead2537dcd3d10b0
18 changes: 14 additions & 4 deletions trunk/drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,23 @@ int acpi_bus_init_power(struct acpi_device *device)
if (result)
return result;

if (device->power.flags.power_resources)
if (state < ACPI_STATE_D3_COLD && device->power.flags.power_resources) {
result = acpi_power_on_resources(device, state);
if (result)
return result;

if (!result)
device->power.state = state;
if (device->power.states[state].flags.explicit_set) {
char method[5] = { '_', 'P', 'S', '0' + state, '\0' };
acpi_status status;

return result;
status = acpi_evaluate_object(device->handle, method,
NULL, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
}
}
device->power.state = state;
return 0;
}

int acpi_bus_update_power(acpi_handle handle, int *state_p)
Expand Down

0 comments on commit 6171ea8

Please sign in to comment.