diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-01-08 00:08:44 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-01 18:30:58 -0500 |
commit | caea99ef339af8e07cda8d03fa415e4b8820f400 (patch) | |
tree | 46b975f61a3409a30fc6a7c15a6db2c7f6d9876b /drivers/acpi | |
parent | 60417f5976df029227450b46d7fa6f0e9b1e654c (diff) |
Hibernation: Introduce begin() and end() callbacks
Introduce global hibernation callback .end() and rename global
hibernation callback .start() to .begin(), in analogy with the
recent modifications of the global suspend callbacks.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/sleep/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index c37c4ead95c..31e8e58e1ce 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -281,7 +281,7 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { #endif /* CONFIG_SUSPEND */ #ifdef CONFIG_HIBERNATION -static int acpi_hibernation_start(void) +static int acpi_hibernation_begin(void) { acpi_target_sleep_state = ACPI_STATE_S4; return 0; @@ -341,6 +341,15 @@ static void acpi_hibernation_finish(void) acpi_target_sleep_state = ACPI_STATE_S0; } +static void acpi_hibernation_end(void) +{ + /* + * This is necessary in case acpi_hibernation_finish() is not called + * during a failing transition to the sleep state. + */ + acpi_target_sleep_state = ACPI_STATE_S0; +} + static int acpi_hibernation_pre_restore(void) { acpi_status status; @@ -356,7 +365,8 @@ static void acpi_hibernation_restore_cleanup(void) } static struct platform_hibernation_ops acpi_hibernation_ops = { - .start = acpi_hibernation_start, + .begin = acpi_hibernation_begin, + .end = acpi_hibernation_end, .pre_snapshot = acpi_hibernation_prepare, .finish = acpi_hibernation_finish, .prepare = acpi_hibernation_prepare, |