Skip to content

Commit

Permalink
ACPI / thermal: Add check of "_TZD" availability and evaluating result
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lan Tianyu authored and Rafael J. Wysocki committed Aug 28, 2013
1 parent 7702ae0 commit 668e020
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,14 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
break;
}

if (flag & ACPI_TRIPS_DEVICES) {
memset(&devices, 0, sizeof(struct acpi_handle_list));
if ((flag & ACPI_TRIPS_DEVICES)
&& acpi_has_method(tz->device->handle, "_TZD")) {
memset(&devices, 0, sizeof(devices));
status = acpi_evaluate_reference(tz->device->handle, "_TZD",
NULL, &devices);
if (memcmp(&tz->devices, &devices,
sizeof(struct acpi_handle_list))) {
memcpy(&tz->devices, &devices,
sizeof(struct acpi_handle_list));
if (ACPI_SUCCESS(status)
&& memcmp(&tz->devices, &devices, sizeof(devices))) {
tz->devices = devices;
ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
}
}
Expand Down

0 comments on commit 668e020

Please sign in to comment.