Skip to content

Commit

Permalink
ACPI: update thermal temperature
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhang, Rui authored and Len Brown committed Apr 29, 2008
1 parent 9030062 commit 76ecb4f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 76ecb4f

Please sign in to comment.