diff options
Diffstat (limited to 'drivers/acpi/sleep')
-rw-r--r-- | drivers/acpi/sleep/main.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 485de1347075..7f97e32fc33f 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -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) |