aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r--drivers/thermal/thermal_core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4962a6aaf295..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)
@@ -1038,7 +1039,8 @@ static void thermal_release(struct device *dev)
1038 sizeof("thermal_zone") - 1)) { 1039 sizeof("thermal_zone") - 1)) {
1039 tz = to_thermal_zone(dev); 1040 tz = to_thermal_zone(dev);
1040 kfree(tz); 1041 kfree(tz);
1041 } else { 1042 } else if(!strncmp(dev_name(dev), "cooling_device",
1043 sizeof("cooling_device") - 1)){
1042 cdev = to_cooling_device(dev); 1044 cdev = to_cooling_device(dev);
1043 kfree(cdev); 1045 kfree(cdev);
1044 } 1046 }