summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang, Rui <rui.zhang@intel.com>2008-04-10 10:20:23 +0200
committerLen Brown <len.brown@intel.com>2008-04-29 08:53:42 +0200
commit76ecb4f2d7ea5c3aac8970b9529775316507c6d2 (patch)
tree313f2bb9b6f5ef62dbf08f587c3a71b9bcae1eef /drivers/acpi
parentACPI: elide a non-zero test on a result that is never 0 (diff)
downloadlinux-76ecb4f2d7ea5c3aac8970b9529775316507c6d2.tar.xz
linux-76ecb4f2d7ea5c3aac8970b9529775316507c6d2.zip
ACPI: update thermal temperature
Fix the problem that thermal_get_temp returns the cached value, which causes the temperature in generic thermal never updates. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/thermal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 5e9641c93fcd..782c2250443e 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -884,10 +884,15 @@ static void acpi_thermal_check(void *data)
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
+ int result;
if (!tz)
return -EINVAL;
+ result = acpi_thermal_get_temperature(tz);
+ if (result)
+ return result;
+
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}