Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
[linux-2.6-microblaze.git] / kernel / power / disk.c
index 81d4d98..d722349 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/fs.h>
 #include <linux/mount.h>
 #include <linux/pm.h>
+#include <linux/cpu.h>
 
 #include "power.h"
 
@@ -72,7 +73,10 @@ static int prepare_processes(void)
        int error;
 
        pm_prepare_console();
-       disable_nonboot_cpus();
+
+       error = disable_nonboot_cpus();
+       if (error)
+               goto enable_cpus;
 
        if (freeze_processes()) {
                error = -EBUSY;
@@ -84,6 +88,7 @@ static int prepare_processes(void)
                return 0;
 thaw:
        thaw_processes();
+enable_cpus:
        enable_nonboot_cpus();
        pm_restore_console();
        return error;
@@ -98,7 +103,7 @@ static void unprepare_processes(void)
 }
 
 /**
- *     pm_suspend_disk - The granpappy of power management.
+ *     pm_suspend_disk - The granpappy of hibernation power management.
  *
  *     If we're going through the firmware, then get it over with quickly.
  *
@@ -207,7 +212,7 @@ static int software_resume(void)
 
        pr_debug("PM: Preparing devices for restore.\n");
 
-       if ((error = device_suspend(PMSG_FREEZE))) {
+       if ((error = device_suspend(PMSG_PRETHAW))) {
                printk("Some devices failed to suspend\n");
                swsusp_free();
                goto Thaw;
@@ -231,7 +236,7 @@ static int software_resume(void)
 late_initcall(software_resume);
 
 
-static char * pm_disk_modes[] = {
+static const char * const pm_disk_modes[] = {
        [PM_DISK_FIRMWARE]      = "firmware",
        [PM_DISK_PLATFORM]      = "platform",
        [PM_DISK_SHUTDOWN]      = "shutdown",