]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/power/hibernate.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / kernel / power / hibernate.c
index 048d0b5148319db70883ee0c9963459c22048385..1832bd2642192970f2fe9e1b759b737e9519b1cf 100644 (file)
@@ -51,18 +51,18 @@ enum {
 
 static int hibernation_mode = HIBERNATION_SHUTDOWN;
 
-static struct platform_hibernation_ops *hibernation_ops;
+static const struct platform_hibernation_ops *hibernation_ops;
 
 /**
  * hibernation_set_ops - set the global hibernate operations
  * @ops: the hibernation operations to use in subsequent hibernation transitions
  */
 
-void hibernation_set_ops(struct platform_hibernation_ops *ops)
+void hibernation_set_ops(const struct platform_hibernation_ops *ops)
 {
        if (ops && !(ops->begin && ops->end &&  ops->pre_snapshot
            && ops->prepare && ops->finish && ops->enter && ops->pre_restore
-           && ops->restore_cleanup)) {
+           && ops->restore_cleanup && ops->leave)) {
                WARN_ON(1);
                return;
        }
@@ -278,7 +278,7 @@ static int create_image(int platform_mode)
                goto Enable_irqs;
        }
 
-       if (hibernation_test(TEST_CORE) || !pm_check_wakeup_events())
+       if (hibernation_test(TEST_CORE) || pm_wakeup_pending())
                goto Power_up;
 
        in_suspend = 1;
@@ -516,7 +516,7 @@ int hibernation_platform_enter(void)
 
        local_irq_disable();
        sysdev_suspend(PMSG_HIBERNATE);
-       if (!pm_check_wakeup_events()) {
+       if (pm_wakeup_pending()) {
                error = -EAGAIN;
                goto Power_up;
        }
@@ -647,6 +647,7 @@ int hibernate(void)
                swsusp_free();
                if (!error)
                        power_down();
+               in_suspend = 0;
                pm_restore_gfp_mask();
        } else {
                pr_debug("PM: Image restored successfully.\n");