Commit 76ecb4f2 authored by Zhang, Rui's avatar Zhang, Rui Committed by Len Brown

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: default avatarZhang Rui <rui.zhang@intel.com>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 9030062f
...@@ -884,10 +884,15 @@ static void acpi_thermal_check(void *data) ...@@ -884,10 +884,15 @@ static void acpi_thermal_check(void *data)
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf) static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{ {
struct acpi_thermal *tz = thermal->devdata; struct acpi_thermal *tz = thermal->devdata;
int result;
if (!tz) if (!tz)
return -EINVAL; return -EINVAL;
result = acpi_thermal_get_temperature(tz);
if (result)
return result;
return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature)); return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
} }
......
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