aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNi Wade <wni@nvidia.com>2013-11-06 01:30:13 -0500
committerZhang Rui <rui.zhang@intel.com>2013-11-06 02:33:46 -0500
commita9f2d19ba7be38590c84487359891d45a66b62f4 (patch)
treea4bf5768771725f7e47662a3aac0de13e24d871e
parent73b9bcd76d13716cc0e0ab053f8c1ae41f47636e (diff)
thermal: Fix binding problem when there is thermal zone params
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>
-rw-r--r--drivers/thermal/thermal_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index db99b334712a..03a567199bbe 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
247 if (!pos->tzp && !pos->ops->bind) 247 if (!pos->tzp && !pos->ops->bind)
248 continue; 248 continue;
249 249
250 if (!pos->tzp && pos->ops->bind) { 250 if (pos->ops->bind) {
251 ret = pos->ops->bind(pos, cdev); 251 ret = pos->ops->bind(pos, cdev);
252 if (ret) 252 if (ret)
253 print_bind_err_msg(pos, cdev, ret); 253 print_bind_err_msg(pos, cdev, ret);
254 continue;
254 } 255 }
255 256
256 tzp = pos->tzp; 257 tzp = pos->tzp;
@@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz)
282 283
283 mutex_lock(&thermal_list_lock); 284 mutex_lock(&thermal_list_lock);
284 285
285 /* If there is no platform data, try to use ops->bind */ 286 /* If there is ops->bind, try to use ops->bind */
286 if (!tzp && tz->ops->bind) { 287 if (tz->ops->bind) {
287 list_for_each_entry(pos, &thermal_cdev_list, node) { 288 list_for_each_entry(pos, &thermal_cdev_list, node) {
288 ret = tz->ops->bind(tz, pos); 289 ret = tz->ops->bind(tz, pos);
289 if (ret) 290 if (ret)