Skip to content

Commit

Permalink
ACPI / PM: Sanitize checks in acpi_power_on_resources()
Browse files Browse the repository at this point in the history
After the only user of acpi_power_on_resources(),
acpi_bus_init_power(), has been changed to avoid calling it
for state equal to ACPI_STATE_D3_COLD, it doesn't have to special
case that state any more.

For this reason, modify the checks in acpi_power_on_resources()
so that it returns -EINVAL for ACPI_STATE_D3_COLD as it should.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Jan 22, 2013
1 parent e78adb7 commit 87e753b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,9 @@ int acpi_power_get_inferred_state(struct acpi_device *device, int *state)

int acpi_power_on_resources(struct acpi_device *device, int state)
{
if (!device || state < ACPI_STATE_D0 || state > ACPI_STATE_D3_COLD)
if (!device || state < ACPI_STATE_D0 || state > ACPI_STATE_D3_HOT)
return -EINVAL;

if (state == ACPI_STATE_D3_COLD)
return 0;

return acpi_power_on_list(&device->power.states[state].resources);
}

Expand Down

0 comments on commit 87e753b

Please sign in to comment.