aboutsummaryrefslogtreecommitdiff
path: root/kernel/power/hibernate.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-11-29 14:50:17 +0000
committerArnd Bergmann <arnd@arndb.de>2011-11-29 14:50:17 +0000
commit98014be39bda8277a5ad130bb274ed6eb18b74df (patch)
tree974620a47c9350ff9b3c06ffd2b49470bbda72ab /kernel/power/hibernate.c
parent55135dfbf3dd83cb3e98deed8271b62d188404e1 (diff)
parent6e2a587eb99267367409097b70cb2d61b09e5269 (diff)
Merge branch 'defconfigs-for-arnd' of git://git.linaro.org/people/triad/linux-stericsson into fixes
Diffstat (limited to 'kernel/power/hibernate.c')
-rw-r--r--kernel/power/hibernate.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index b4511b6d3ef..196c01268eb 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -55,6 +55,8 @@ enum {
static int hibernation_mode = HIBERNATION_SHUTDOWN;
+static bool freezer_test_done;
+
static const struct platform_hibernation_ops *hibernation_ops;
/**
@@ -347,6 +349,17 @@ int hibernation_snapshot(int platform_mode)
if (error)
goto Close;
+ if (hibernation_test(TEST_FREEZER) ||
+ hibernation_testmode(HIBERNATION_TESTPROC)) {
+
+ /*
+ * Indicate to the caller that we are returning due to a
+ * successful freezer test.
+ */
+ freezer_test_done = true;
+ goto Close;
+ }
+
error = dpm_prepare(PMSG_FREEZE);
if (error)
goto Complete_devices;
@@ -641,15 +654,13 @@ int hibernate(void)
if (error)
goto Finish;
- if (hibernation_test(TEST_FREEZER))
- goto Thaw;
-
- if (hibernation_testmode(HIBERNATION_TESTPROC))
- goto Thaw;
-
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
if (error)
goto Thaw;
+ if (freezer_test_done) {
+ freezer_test_done = false;
+ goto Thaw;
+ }
if (in_suspend) {
unsigned int flags = 0;