]> git.karo-electronics.de Git - linux-beck.git/commitdiff
thermal: Fix binding problem when there is thermal zone params
authorNi Wade <wni@nvidia.com>
Wed, 6 Nov 2013 06:30:13 +0000 (14:30 +0800)
committerZhang Rui <rui.zhang@intel.com>
Wed, 6 Nov 2013 07:33:46 +0000 (15:33 +0800)
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.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/thermal_core.c

index db99b334712a3ee0720af40537fcefb0e2ed327d..03a567199bbe313cd36dd0a4d62e3d9f7cab957d 100644 (file)
@@ -247,10 +247,11 @@ 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);
+                       continue;
                }
 
                tzp = pos->tzp;
@@ -282,8 +283,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)