PM / hibernate: Add missing braces in hibernate_setup()
[cascardo/linux.git] / kernel / power / hibernate.c
index fca9254..b00f270 100644 (file)
@@ -647,7 +647,7 @@ static void power_down(void)
  */
 int hibernate(void)
 {
-       int error;
+       int error, nr_calls = 0;
 
        if (!hibernation_available()) {
                pr_debug("PM: Hibernation not available.\n");
@@ -662,9 +662,11 @@ int hibernate(void)
        }
 
        pm_prepare_console();
-       error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
-       if (error)
+       error = __pm_notifier_call_chain(PM_HIBERNATION_PREPARE, -1, &nr_calls);
+       if (error) {
+               nr_calls--;
                goto Exit;
+       }
 
        printk(KERN_INFO "PM: Syncing filesystems ... ");
        sys_sync();
@@ -714,7 +716,7 @@ int hibernate(void)
        /* Don't bother checking whether freezer_test_done is true */
        freezer_test_done = false;
  Exit:
-       pm_notifier_call_chain(PM_POST_HIBERNATION);
+       __pm_notifier_call_chain(PM_POST_HIBERNATION, nr_calls, NULL);
        pm_restore_console();
        atomic_inc(&snapshot_device_available);
  Unlock:
@@ -740,7 +742,7 @@ int hibernate(void)
  */
 static int software_resume(void)
 {
-       int error;
+       int error, nr_calls = 0;
        unsigned int flags;
 
        /*
@@ -827,9 +829,11 @@ static int software_resume(void)
        }
 
        pm_prepare_console();
-       error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
-       if (error)
+       error = __pm_notifier_call_chain(PM_RESTORE_PREPARE, -1, &nr_calls);
+       if (error) {
+               nr_calls--;
                goto Close_Finish;
+       }
 
        pr_debug("PM: Preparing processes for restore.\n");
        error = freeze_processes();
@@ -855,7 +859,7 @@ static int software_resume(void)
        unlock_device_hotplug();
        thaw_processes();
  Finish:
-       pm_notifier_call_chain(PM_POST_RESTORE);
+       __pm_notifier_call_chain(PM_POST_RESTORE, nr_calls, NULL);
        pm_restore_console();
        atomic_inc(&snapshot_device_available);
        /* For success case, the suspend path will release the lock */
@@ -1115,11 +1119,11 @@ static int __init resume_offset_setup(char *str)
 
 static int __init hibernate_setup(char *str)
 {
-       if (!strncmp(str, "noresume", 8))
+       if (!strncmp(str, "noresume", 8)) {
                noresume = 1;
-       else if (!strncmp(str, "nocompress", 10))
+       } else if (!strncmp(str, "nocompress", 10)) {
                nocompress = 1;
-       else if (!strncmp(str, "no", 2)) {
+       else if (!strncmp(str, "no", 2)) {
                noresume = 1;
                nohibernate = 1;
        }