Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200402
b: refs/heads/master
c: 2a6b697
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Garrett authored and Len Brown committed Jun 10, 2010
1 parent dc0a10d commit 0401a9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd4c4f17d722ffeb2515bf781400675a30fcead7
refs/heads/master: 2a6b69765ad794389f2fc3e14a0afa1a995221c2
21 changes: 13 additions & 8 deletions trunk/drivers/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static int __acpi_pm_prepare(void)
{
int error = acpi_sleep_prepare(acpi_target_sleep_state);

suspend_nvs_save();

if (error)
acpi_target_sleep_state = ACPI_STATE_S0;
return error;
Expand Down Expand Up @@ -140,6 +142,8 @@ static void acpi_pm_finish(void)
{
u32 acpi_state = acpi_target_sleep_state;

suspend_nvs_free();

if (acpi_state == ACPI_STATE_S0)
return;

Expand Down Expand Up @@ -189,6 +193,11 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
u32 acpi_state = acpi_suspend_states[pm_state];
int error = 0;

error = suspend_nvs_alloc();

if (error)
return error;

if (sleep_states[acpi_state]) {
acpi_target_sleep_state = acpi_state;
acpi_sleep_tts_switch(acpi_target_sleep_state);
Expand Down Expand Up @@ -264,6 +273,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
if (acpi_state == ACPI_STATE_S3)
acpi_restore_state_mem();

suspend_nvs_restore();

return ACPI_SUCCESS(status) ? 0 : -EFAULT;
}

Expand Down Expand Up @@ -430,12 +441,6 @@ static int acpi_hibernation_enter(void)
return ACPI_SUCCESS(status) ? 0 : -EFAULT;
}

static void acpi_hibernation_finish(void)
{
suspend_nvs_free();
acpi_pm_finish();
}

static void acpi_hibernation_leave(void)
{
/*
Expand Down Expand Up @@ -473,7 +478,7 @@ static struct platform_hibernation_ops acpi_hibernation_ops = {
.begin = acpi_hibernation_begin,
.end = acpi_pm_end,
.pre_snapshot = acpi_hibernation_pre_snapshot,
.finish = acpi_hibernation_finish,
.finish = acpi_pm_finish,
.prepare = acpi_pm_prepare,
.enter = acpi_hibernation_enter,
.leave = acpi_hibernation_leave,
Expand Down Expand Up @@ -526,7 +531,7 @@ static struct platform_hibernation_ops acpi_hibernation_ops_old = {
.begin = acpi_hibernation_begin_old,
.end = acpi_pm_end,
.pre_snapshot = acpi_hibernation_pre_snapshot_old,
.finish = acpi_hibernation_finish,
.finish = acpi_pm_finish,
.prepare = acpi_pm_disable_gpes,
.enter = acpi_hibernation_enter,
.leave = acpi_hibernation_leave,
Expand Down

0 comments on commit 0401a9e

Please sign in to comment.