aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-01-17 02:51:18 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 23:21:03 -0500
commit653a00c9662304ef72a3eb4e681c91720960e0b4 (patch)
tree5773757047d5c81f8d19d17bd331a5d13734766f /drivers/acpi
parentcc0573b3250214034062ddf8c64359596d8af521 (diff)
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: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Thomas Sujith <sujith.thomas@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/thermal.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index aee371f9daf8..73f276bc6e4f 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1015,7 +1015,9 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
1015{ 1015{
1016 struct acpi_device *device = cdev->devdata; 1016 struct acpi_device *device = cdev->devdata;
1017 struct acpi_thermal *tz = thermal->devdata; 1017 struct acpi_thermal *tz = thermal->devdata;
1018 acpi_handle handle = device->handle; 1018 struct acpi_device *dev;
1019 acpi_status status;
1020 acpi_handle handle;
1019 int i; 1021 int i;
1020 int j; 1022 int j;
1021 int trip = -1; 1023 int trip = -1;
@@ -1031,12 +1033,13 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
1031 trip++; 1033 trip++;
1032 for (i = 0; i < tz->trips.passive.devices.count; 1034 for (i = 0; i < tz->trips.passive.devices.count;
1033 i++) { 1035 i++) {
1034 if (tz->trips.passive.devices.handles[i] != 1036 handle = tz->trips.passive.devices.handles[i];
1035 handle) 1037 status = acpi_bus_get_device(handle, &dev);
1036 continue; 1038 if (ACPI_SUCCESS(status) && (dev == device)) {
1037 result = action(thermal, trip, cdev); 1039 result = action(thermal, trip, cdev);
1038 if (result) 1040 if (result)
1039 goto failed; 1041 goto failed;
1042 }
1040 } 1043 }
1041 } 1044 }
1042 1045
@@ -1047,21 +1050,24 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
1047 for (j = 0; 1050 for (j = 0;
1048 j < tz->trips.active[i].devices.count; 1051 j < tz->trips.active[i].devices.count;
1049 j++) { 1052 j++) {
1050 if (tz->trips.active[i].devices. 1053 handle = tz->trips.active[i].devices.handles[j];
1051 handles[j] != handle) 1054 status = acpi_bus_get_device(handle, &dev);
1052 continue; 1055 if (ACPI_SUCCESS(status) && (dev == device)) {
1053 result = action(thermal, trip, cdev); 1056 result = action(thermal, trip, cdev);
1054 if (result) 1057 if (result)
1055 goto failed; 1058 goto failed;
1059 }
1056 } 1060 }
1057 } 1061 }
1058 1062
1059 for (i = 0; i < tz->devices.count; i++) { 1063 for (i = 0; i < tz->devices.count; i++) {
1060 if (tz->devices.handles[i] != handle) 1064 handle = tz->devices.handles[i];
1061 continue; 1065 status = acpi_bus_get_device(handle, &dev);
1062 result = action(thermal, -1, cdev); 1066 if (ACPI_SUCCESS(status) && (dev == device)) {
1063 if (result) 1067 result = action(thermal, -1, cdev);
1064 goto failed; 1068 if (result)
1069 goto failed;
1070 }
1065 } 1071 }
1066 1072
1067failed: 1073failed: