Skip to content

Commit

Permalink
thermal: Fix binding problem when there is thermal zone params
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ni Wade authored and Zhang Rui committed Nov 6, 2013
1 parent 73b9bcd commit a9f2d19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a9f2d19

Please sign in to comment.