diff options
| author | 2011-11-29 14:50:17 +0000 | |
|---|---|---|
| committer | 2011-11-29 14:50:17 +0000 | |
| commit | 98014be39bda8277a5ad130bb274ed6eb18b74df (patch) | |
| tree | 974620a47c9350ff9b3c06ffd2b49470bbda72ab /kernel/power/hibernate.c | |
| parent | Merge branch 'fixes-dss' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes (diff) | |
| parent | ARM: ux500: update defconfig (diff) | |
| download | wireguard-linux-98014be39bda8277a5ad130bb274ed6eb18b74df.tar.xz wireguard-linux-98014be39bda8277a5ad130bb274ed6eb18b74df.zip | |
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.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index b4511b6d3ef9..196c01268ebd 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; |
