diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2013-08-27 04:29:31 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-28 15:47:07 -0400 |
commit | 668e02004462487df8ec6c65c665ddb8af78dc12 (patch) | |
tree | 219461522ad0444b63a1e9e62fbe28d4652bd653 /drivers/acpi | |
parent | 7702ae0dd9b40930931914866999a2ac9734d3eb (diff) |
ACPI / thermal: Add check of "_TZD" availability and evaluating result
Some machines don't provide _TZD, so check the availability of it
before carrying out futher operations.
If _TZD is present, also check the result of its evaluation.
[rjw: Changelog]
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/thermal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index ccf9527d7ed3..0055c83c26c0 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -485,14 +485,14 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) | |||
485 | break; | 485 | break; |
486 | } | 486 | } |
487 | 487 | ||
488 | if (flag & ACPI_TRIPS_DEVICES) { | 488 | if ((flag & ACPI_TRIPS_DEVICES) |
489 | memset(&devices, 0, sizeof(struct acpi_handle_list)); | 489 | && acpi_has_method(tz->device->handle, "_TZD")) { |
490 | memset(&devices, 0, sizeof(devices)); | ||
490 | status = acpi_evaluate_reference(tz->device->handle, "_TZD", | 491 | status = acpi_evaluate_reference(tz->device->handle, "_TZD", |
491 | NULL, &devices); | 492 | NULL, &devices); |
492 | if (memcmp(&tz->devices, &devices, | 493 | if (ACPI_SUCCESS(status) |
493 | sizeof(struct acpi_handle_list))) { | 494 | && memcmp(&tz->devices, &devices, sizeof(devices))) { |
494 | memcpy(&tz->devices, &devices, | 495 | tz->devices = devices; |
495 | sizeof(struct acpi_handle_list)); | ||
496 | ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); | 496 | ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); |
497 | } | 497 | } |
498 | } | 498 | } |