]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/sleep/poweroff.c
[ACPI] fix run-time error checking in acpi_pci_irq_disable()
[linux-2.6-omap-h63xx.git] / drivers / acpi / sleep / poweroff.c
index 186b182c582522810c22fd44cecf88afd87c97f1..a5f947de879bc62a52ade449c729cf5ffe5b69c5 100644 (file)
@@ -55,7 +55,11 @@ void acpi_power_off(void)
 
 static int acpi_shutdown(struct sys_device *x)
 {
-       return acpi_sleep_prepare(ACPI_STATE_S5);
+       if (system_state == SYSTEM_POWER_OFF) {
+               /* Prepare if we are going to power off the system */
+               return acpi_sleep_prepare(ACPI_STATE_S5);
+       }
+       return 0;
 }
 
 static struct sysdev_class acpi_sysclass = {
@@ -91,4 +95,4 @@ static int acpi_poweroff_init(void)
 
 late_initcall(acpi_poweroff_init);
 
-#endif /* CONFIG_PM */
+#endif                         /* CONFIG_PM */