aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-01-07 18:08:44 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:58 -0500
commitcaea99ef339af8e07cda8d03fa415e4b8820f400 (patch)
tree46b975f61a3409a30fc6a7c15a6db2c7f6d9876b /drivers/acpi/sleep
parent60417f5976df029227450b46d7fa6f0e9b1e654c (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/sleep')
-rw-r--r--drivers/acpi/sleep/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index c37c4ead95c9..31e8e58e1cec 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[] = {
281#endif /* CONFIG_SUSPEND */ 281#endif /* CONFIG_SUSPEND */
282 282
283#ifdef CONFIG_HIBERNATION 283#ifdef CONFIG_HIBERNATION
284static int acpi_hibernation_start(void) 284static int acpi_hibernation_begin(void)
285{ 285{
286 acpi_target_sleep_state = ACPI_STATE_S4; 286 acpi_target_sleep_state = ACPI_STATE_S4;
287 return 0; 287 return 0;
@@ -341,6 +341,15 @@ static void acpi_hibernation_finish(void)
341 acpi_target_sleep_state = ACPI_STATE_S0; 341 acpi_target_sleep_state = ACPI_STATE_S0;
342} 342}
343 343
344static void acpi_hibernation_end(void)
345{
346 /*
347 * This is necessary in case acpi_hibernation_finish() is not called
348 * during a failing transition to the sleep state.
349 */
350 acpi_target_sleep_state = ACPI_STATE_S0;
351}
352
344static int acpi_hibernation_pre_restore(void) 353static int acpi_hibernation_pre_restore(void)
345{ 354{
346 acpi_status status; 355 acpi_status status;
@@ -356,7 +365,8 @@ static void acpi_hibernation_restore_cleanup(void)
356} 365}
357 366
358static struct platform_hibernation_ops acpi_hibernation_ops = { 367static struct platform_hibernation_ops acpi_hibernation_ops = {
359 .start = acpi_hibernation_start, 368 .begin = acpi_hibernation_begin,
369 .end = acpi_hibernation_end,
360 .pre_snapshot = acpi_hibernation_prepare, 370 .pre_snapshot = acpi_hibernation_prepare,
361 .finish = acpi_hibernation_finish, 371 .finish = acpi_hibernation_finish,
362 .prepare = acpi_hibernation_prepare, 372 .prepare = acpi_hibernation_prepare,