]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
thermal: check return value of update_temperature
authorJinyoung Park <jinyoungp@nvidia.com>
Thu, 26 Jun 2014 00:48:58 +0000 (09:48 +0900)
committerDhiren Parmar <dparmar@nvidia.com>
Fri, 11 Jul 2014 09:39:01 +0000 (02:39 -0700)
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
(cherry picked from commit d7254186c9a2a6aeaf360d853c332a33ef9f0ff8)
Reviewed-on: http://git-master/r/436688
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/thermal/thermal_core.c

index 9fad88c635bea08b9ee53b1d1aea47abc9d45acf..e78f93dfc5386c89c2a5779598823dfe8ab0b039 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);