Commit a9f2d19b authored by Ni Wade's avatar Ni Wade Committed by Zhang Rui

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: default avatarWei Ni <wni@nvidia.com>
Signed-off-by: default avatarJinyoung Park <jinyoungp@nvidia.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 73b9bcd7
...@@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev) ...@@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
if (!pos->tzp && !pos->ops->bind) if (!pos->tzp && !pos->ops->bind)
continue; continue;
if (!pos->tzp && pos->ops->bind) { if (pos->ops->bind) {
ret = pos->ops->bind(pos, cdev); ret = pos->ops->bind(pos, cdev);
if (ret) if (ret)
print_bind_err_msg(pos, cdev, ret); print_bind_err_msg(pos, cdev, ret);
continue;
} }
tzp = pos->tzp; tzp = pos->tzp;
...@@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz) ...@@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz)
mutex_lock(&thermal_list_lock); mutex_lock(&thermal_list_lock);
/* If there is no platform data, try to use ops->bind */ /* If there is ops->bind, try to use ops->bind */
if (!tzp && tz->ops->bind) { if (tz->ops->bind) {
list_for_each_entry(pos, &thermal_cdev_list, node) { list_for_each_entry(pos, &thermal_cdev_list, node) {
ret = tz->ops->bind(tz, pos); ret = tz->ops->bind(tz, pos);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment