Thermal: Fix binding problem when there is thermal zone params
Jinyoung Park [Thu, 31 Jan 2013 12:32:21 +0000 (21:32 +0900)]
The thermal zone params can be used to set governor to specific thermal
governor for thermal zone device. But if the thermal zone params has only
governor name without thermal bind params, then the thermal zone device
will not be binding to cooling device. Because tz->ops->bind operator is not
invoked in bind_tz() and bind_cdev() when there is thermal zone params.

Bug 1200111

Change-Id: Ieee33ea308ac554b3553c5a038979955b6579ab0
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/196026
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

drivers/thermal/thermal_sys.c

index 951480e..b4bdcea 100644 (file)
@@ -255,7 +255,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
                if (!pos->tzp && !pos->ops->bind)
                        continue;
 
-               if (!pos->tzp && pos->ops->bind) {
+               if (pos->ops->bind) {
                        ret = pos->ops->bind(pos, cdev);
                        if (ret)
                                print_bind_err_msg(pos, cdev, ret);
@@ -289,8 +289,8 @@ static void bind_tz(struct thermal_zone_device *tz)
 
        mutex_lock(&thermal_list_lock);
 
-       /* If there is no platform data, try to use ops->bind */
-       if (!tzp && tz->ops->bind) {
+       /* If there is ops->bind, try to use ops->bind */
+       if (tz->ops->bind) {
                list_for_each_entry(pos, &thermal_cdev_list, node) {
                        ret = tz->ops->bind(tz, pos);
                        if (ret)