diff options
Diffstat (limited to 'drivers/acpi')
-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 2c0b6630f8ba..99181c8f023e 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -386,11 +386,20 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) | |||
386 | if (acpi_target_sleep_state == ACPI_STATE_S0 || | 386 | if (acpi_target_sleep_state == ACPI_STATE_S0 || |
387 | (wake && adev->wakeup.state.enabled && | 387 | (wake && adev->wakeup.state.enabled && |
388 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { | 388 | adev->wakeup.sleep_state <= acpi_target_sleep_state)) { |
389 | acpi_status status; | ||
390 | |||
389 | acpi_method[3] = 'W'; | 391 | acpi_method[3] = 'W'; |
390 | acpi_evaluate_integer(handle, acpi_method, NULL, &d_max); | 392 | status = acpi_evaluate_integer(handle, acpi_method, NULL, |
391 | /* Sanity check */ | 393 | &d_max); |
392 | if (d_max < d_min) | 394 | if (ACPI_FAILURE(status)) { |
395 | d_max = d_min; | ||
396 | } else if (d_max < d_min) { | ||
397 | /* Warn the user of the broken DSDT */ | ||
398 | printk(KERN_WARNING "ACPI: Wrong value from %s\n", | ||
399 | acpi_method); | ||
400 | /* Sanitize it */ | ||
393 | d_min = d_max; | 401 | d_min = d_max; |
402 | } | ||
394 | } | 403 | } |
395 | 404 | ||
396 | if (d_min_p) | 405 | if (d_min_p) |