aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-05-28 16:32:14 -0400
committerLen Brown <len.brown@intel.com>2010-06-10 11:02:34 -0400
commitdd4c4f17d722ffeb2515bf781400675a30fcead7 (patch)
tree0190eff340ffeac7800a3d7d1e0c1232c09397ef /drivers/acpi
parent67a3e12b05e055c0415c556a315a3d3eb637e29e (diff)
suspend: Move NVS save/restore code to generic suspend functionality
Saving platform non-volatile state may be required for suspend to RAM as well as hibernation. Move it to more generic code. Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Tested-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/sleep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 4ab2275b4461..bcaa6efa8136 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -393,7 +393,7 @@ static int acpi_hibernation_begin(void)
393{ 393{
394 int error; 394 int error;
395 395
396 error = s4_no_nvs ? 0 : hibernate_nvs_alloc(); 396 error = s4_no_nvs ? 0 : suspend_nvs_alloc();
397 if (!error) { 397 if (!error) {
398 acpi_target_sleep_state = ACPI_STATE_S4; 398 acpi_target_sleep_state = ACPI_STATE_S4;
399 acpi_sleep_tts_switch(acpi_target_sleep_state); 399 acpi_sleep_tts_switch(acpi_target_sleep_state);
@@ -407,7 +407,7 @@ static int acpi_hibernation_pre_snapshot(void)
407 int error = acpi_pm_prepare(); 407 int error = acpi_pm_prepare();
408 408
409 if (!error) 409 if (!error)
410 hibernate_nvs_save(); 410 suspend_nvs_save();
411 411
412 return error; 412 return error;
413} 413}
@@ -432,7 +432,7 @@ static int acpi_hibernation_enter(void)
432 432
433static void acpi_hibernation_finish(void) 433static void acpi_hibernation_finish(void)
434{ 434{
435 hibernate_nvs_free(); 435 suspend_nvs_free();
436 acpi_pm_finish(); 436 acpi_pm_finish();
437} 437}
438 438
@@ -452,7 +452,7 @@ static void acpi_hibernation_leave(void)
452 panic("ACPI S4 hardware signature mismatch"); 452 panic("ACPI S4 hardware signature mismatch");
453 } 453 }
454 /* Restore the NVS memory area */ 454 /* Restore the NVS memory area */
455 hibernate_nvs_restore(); 455 suspend_nvs_restore();
456} 456}
457 457
458static int acpi_pm_pre_restore(void) 458static int acpi_pm_pre_restore(void)
@@ -501,7 +501,7 @@ static int acpi_hibernation_begin_old(void)
501 501
502 if (!error) { 502 if (!error) {
503 if (!s4_no_nvs) 503 if (!s4_no_nvs)
504 error = hibernate_nvs_alloc(); 504 error = suspend_nvs_alloc();
505 if (!error) 505 if (!error)
506 acpi_target_sleep_state = ACPI_STATE_S4; 506 acpi_target_sleep_state = ACPI_STATE_S4;
507 } 507 }
@@ -513,7 +513,7 @@ static int acpi_hibernation_pre_snapshot_old(void)
513 int error = acpi_pm_disable_gpes(); 513 int error = acpi_pm_disable_gpes();
514 514
515 if (!error) 515 if (!error)
516 hibernate_nvs_save(); 516 suspend_nvs_save();
517 517
518 return error; 518 return error;
519} 519}