Commit 668e0200 authored by Lan Tianyu's avatar Lan Tianyu Committed by Rafael J. Wysocki

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: default avatarLan Tianyu <tianyu.lan@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7702ae0d
...@@ -485,14 +485,14 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) ...@@ -485,14 +485,14 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
break; break;
} }
if (flag & ACPI_TRIPS_DEVICES) { if ((flag & ACPI_TRIPS_DEVICES)
memset(&devices, 0, sizeof(struct acpi_handle_list)); && acpi_has_method(tz->device->handle, "_TZD")) {
memset(&devices, 0, sizeof(devices));
status = acpi_evaluate_reference(tz->device->handle, "_TZD", status = acpi_evaluate_reference(tz->device->handle, "_TZD",
NULL, &devices); NULL, &devices);
if (memcmp(&tz->devices, &devices, if (ACPI_SUCCESS(status)
sizeof(struct acpi_handle_list))) { && memcmp(&tz->devices, &devices, sizeof(devices))) {
memcpy(&tz->devices, &devices, tz->devices = devices;
sizeof(struct acpi_handle_list));
ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device"); ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment