summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorJinyoung Park <jinyoungp@nvidia.com>2014-06-26 09:48:58 +0900
committerEmad Mir <emir@nvidia.com>2014-06-27 11:23:03 -0700
commitd7254186c9a2a6aeaf360d853c332a33ef9f0ff8 (patch)
tree017465e79230cb68ed88a3228f183b20e6ae2e05 /drivers/thermal
parentf54e698bef01860082bc7350704ea99e241cc848 (diff)
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 <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/428636 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_core.c9
1 files changed, 6 insertions, 3 deletions
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);