]> git.hungrycats.org Git - linux/commitdiff
[ACPI] Broken fan detection prevents booting (Shaohua David Li)
authorLen Brown <len.brown@intel.com>
Mon, 20 Oct 2003 19:54:43 +0000 (15:54 -0400)
committerLen Brown <lenb@dhcppc3.>
Mon, 20 Oct 2003 19:54:43 +0000 (15:54 -0400)
  http://bugme.osdl.org/show_bug.cgi?id=1185

drivers/acpi/power.c

index f83a630ec7dc848a8cf55bb8364f4ab37720faac..4ba069e131d2764a3deb82018b0a6bfbe0c70aab 100644 (file)
@@ -337,6 +337,9 @@ acpi_power_transition (
        if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
                return_VALUE(-EINVAL);
 
+       if ((device->power.state < ACPI_STATE_D0) || (device->power.state > ACPI_STATE_D3))
+               return_VALUE(-ENODEV);
+
        cl = &device->power.states[device->power.state].resources;
        tl = &device->power.states[state].resources;
 
@@ -359,8 +362,6 @@ acpi_power_transition (
                        goto end;
        }
 
-       device->power.state = state;
-
        /*
         * Then we dereference all power resources used in the current list.
         */
@@ -370,6 +371,8 @@ acpi_power_transition (
                        goto end;
        }
 
+       /* We shouldn't change the state till all above operations succeed */
+       device->power.state = state;
 end:
        if (result)
                ACPI_DEBUG_PRINT((ACPI_DB_WARN,