thermal: check return value of update_temperature
Jinyoung Park [Thu, 26 Jun 2014 00:48:58 +0000 (09:48 +0900)]
Checking return value of update_temperature.
If return value is not Zero, it does't handle thermal trips.

Bug 200011588
Bug 200015248

Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/428636
(cherry picked from commit d7254186c9a2a6aeaf360d853c332a33ef9f0ff8)

Change-Id: I084e7c53ee132b33fa377d96f6c9e70f26529ffe
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/432580
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/thermal/thermal_core.c

index 9a10b49..19518b7 100644 (file)
@@ -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);