Commit 653a00c9 authored by Zhang Rui's avatar Zhang Rui Committed by Len Brown

ACPI: thermal fixup

The alias name may be used in _PSL, _ALx and _TZD,
so we bind the cooling device only if the acpi_device node matches.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarThomas Sujith <sujith.thomas@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent cc0573b3
...@@ -1015,7 +1015,9 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, ...@@ -1015,7 +1015,9 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
{ {
struct acpi_device *device = cdev->devdata; struct acpi_device *device = cdev->devdata;
struct acpi_thermal *tz = thermal->devdata; struct acpi_thermal *tz = thermal->devdata;
acpi_handle handle = device->handle; struct acpi_device *dev;
acpi_status status;
acpi_handle handle;
int i; int i;
int j; int j;
int trip = -1; int trip = -1;
...@@ -1031,14 +1033,15 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, ...@@ -1031,14 +1033,15 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
trip++; trip++;
for (i = 0; i < tz->trips.passive.devices.count; for (i = 0; i < tz->trips.passive.devices.count;
i++) { i++) {
if (tz->trips.passive.devices.handles[i] != handle = tz->trips.passive.devices.handles[i];
handle) status = acpi_bus_get_device(handle, &dev);
continue; if (ACPI_SUCCESS(status) && (dev == device)) {
result = action(thermal, trip, cdev); result = action(thermal, trip, cdev);
if (result) if (result)
goto failed; goto failed;
} }
} }
}
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
if (!tz->trips.active[i].flags.valid) if (!tz->trips.active[i].flags.valid)
...@@ -1047,22 +1050,25 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, ...@@ -1047,22 +1050,25 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
for (j = 0; for (j = 0;
j < tz->trips.active[i].devices.count; j < tz->trips.active[i].devices.count;
j++) { j++) {
if (tz->trips.active[i].devices. handle = tz->trips.active[i].devices.handles[j];
handles[j] != handle) status = acpi_bus_get_device(handle, &dev);
continue; if (ACPI_SUCCESS(status) && (dev == device)) {
result = action(thermal, trip, cdev); result = action(thermal, trip, cdev);
if (result) if (result)
goto failed; goto failed;
} }
} }
}
for (i = 0; i < tz->devices.count; i++) { for (i = 0; i < tz->devices.count; i++) {
if (tz->devices.handles[i] != handle) handle = tz->devices.handles[i];
continue; status = acpi_bus_get_device(handle, &dev);
if (ACPI_SUCCESS(status) && (dev == device)) {
result = action(thermal, -1, cdev); result = action(thermal, -1, cdev);
if (result) if (result)
goto failed; goto failed;
} }
}
failed: failed:
return result; return result;
......
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