diff options
Diffstat (limited to 'drivers/acpi/sleep/main.c')
-rw-r--r-- | drivers/acpi/sleep/main.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 485de1347075..293a1cbb47c0 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -170,7 +170,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) | |||
170 | /* Reprogram control registers and execute _BFS */ | 170 | /* Reprogram control registers and execute _BFS */ |
171 | acpi_leave_sleep_state_prep(acpi_state); | 171 | acpi_leave_sleep_state_prep(acpi_state); |
172 | 172 | ||
173 | /* ACPI 3.0 specs (P62) says that it's the responsabilty | 173 | /* ACPI 3.0 specs (P62) says that it's the responsibility |
174 | * of the OSPM to clear the status bit [ implying that the | 174 | * of the OSPM to clear the status bit [ implying that the |
175 | * POWER_BUTTON event should not reach userspace ] | 175 | * POWER_BUTTON event should not reach userspace ] |
176 | */ | 176 | */ |
@@ -472,11 +472,20 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) | |||
472 | if (acpi_target_sleep_state == ACPI_STATE_S0 || | 472 | if (acpi_target_sleep_state == ACPI_STATE_S0 || |
473 | (wake && adev->wakeup.state.enabled && | 473 | (wake && adev->wakeup.state.enabled && |
474 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { | 474 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { |
475 | acpi_status status; | ||
476 | |||
475 | acpi_method[3] = 'W'; | 477 | acpi_method[3] = 'W'; |
476 | acpi_evaluate_integer(handle, acpi_method, NULL, &d_max); | 478 | status = acpi_evaluate_integer(handle, acpi_method, NULL, |
477 | /* Sanity check */ | 479 | &d_max); |
478 | if (d_max < d_min) | 480 | if (ACPI_FAILURE(status)) { |
481 | d_max = d_min; | ||
482 | } else if (d_max < d_min) { | ||
483 | /* Warn the user of the broken DSDT */ | ||
484 | printk(KERN_WARNING "ACPI: Wrong value from %s\n", | ||
485 | acpi_method); | ||
486 | /* Sanitize it */ | ||
479 | d_min = d_max; | 487 | d_min = d_max; |
488 | } | ||
480 | } | 489 | } |
481 | 490 | ||
482 | if (d_min_p) | 491 | if (d_min_p) |