diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 67dedeed144cf82c8e13859e7222b976d0eebb2e..792a8309d074a178303eb4c3d467c68a382c760b 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -465,10 +465,12 @@ int acpi_power_transition(struct acpi_device *device, int state) struct acpi_handle_list *tl = NULL; /* Target Resources */ int i = 0; - if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) return -EINVAL; + if (device->power.state == state) + return 0; + if ((device->power.state < ACPI_STATE_D0) || (device->power.state > ACPI_STATE_D3)) return -ENODEV; @@ -488,10 +490,6 @@ int acpi_power_transition(struct acpi_device *device, int state) goto end; } - if (device->power.state == state) { - goto end; - } - /* * Then we dereference all power resources used in the current list. */