From d7254186c9a2a6aeaf360d853c332a33ef9f0ff8 Mon Sep 17 00:00:00 2001 From: Jinyoung Park Date: Thu, 26 Jun 2014 09:48:58 +0900 Subject: thermal: check return value of update_temperature Checking return value of update_temperature. If return value is not Zero, it does't handle thermal trips. Bug 200011588 Bug 200015248 Change-Id: I084e7c53ee132b33fa377d96f6c9e70f26529ffe Signed-off-by: Jinyoung Park Reviewed-on: http://git-master/r/428636 Reviewed-by: Diwakar Tundlam GVS: Gerrit_Virtual_Submit --- drivers/thermal/thermal_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/thermal') diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index dc2481dfdc12..ffb4b9c41a40 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -450,7 +450,7 @@ exit: } EXPORT_SYMBOL_GPL(thermal_zone_get_temp); -static void update_temperature(struct thermal_zone_device *tz) +static int update_temperature(struct thermal_zone_device *tz) { long temp; int ret; @@ -459,13 +459,15 @@ static void update_temperature(struct thermal_zone_device *tz) if (ret) { dev_warn(&tz->device, "failed to read out thermal zone %d\n", tz->id); - return; + return ret; } mutex_lock(&tz->lock); tz->last_temperature = tz->temperature; tz->temperature = temp; mutex_unlock(&tz->lock); + + return 0; } void thermal_zone_device_update(struct thermal_zone_device *tz) @@ -475,7 +477,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) if (!tz || !tz->ops->get_temp || !device_is_registered(&tz->device)) return; - update_temperature(tz); + if (update_temperature(tz)) + return; for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); -- cgit v1.2.3