aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2012-06-26 22:09:00 -0400
committerZhang Rui <rui.zhang@intel.com>2012-09-24 02:44:37 -0400
commit2d374139d5b0b596cfbd892bf3ec7dacb3049904 (patch)
treef1decd1db27b83d0041ad9667813e4c15fef39c1
parentb81b6ba3d9ac5feb14388bb73ac5a39d9a7540dc (diff)
Thermal: Rename thermal_zone_device.cooling_devices
Rename thermal_zone_device.cooling_devices to thermal_zone_device.thermal_instances thermal_zone_device.cooling_devices is not accurate as this is a list for thermal instances, rather than cooling devices. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
-rw-r--r--drivers/thermal/thermal_sys.c18
-rw-r--r--include/linux/thermal.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 3eba3971dae1..797d14891127 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -745,7 +745,7 @@ static void thermal_zone_device_passive(struct thermal_zone_device *tz,
745 745
746 /* Heating up? */ 746 /* Heating up? */
747 if (trend == THERMAL_TREND_RAISING) { 747 if (trend == THERMAL_TREND_RAISING) {
748 list_for_each_entry(instance, &tz->cooling_devices, 748 list_for_each_entry(instance, &tz->thermal_instances,
749 node) { 749 node) {
750 if (instance->trip != trip) 750 if (instance->trip != trip)
751 continue; 751 continue;
@@ -756,7 +756,7 @@ static void thermal_zone_device_passive(struct thermal_zone_device *tz,
756 cdev->ops->set_cur_state(cdev, state); 756 cdev->ops->set_cur_state(cdev, state);
757 } 757 }
758 } else if (trend == THERMAL_TREND_DROPPING) { /* Cooling off? */ 758 } else if (trend == THERMAL_TREND_DROPPING) { /* Cooling off? */
759 list_for_each_entry(instance, &tz->cooling_devices, 759 list_for_each_entry(instance, &tz->thermal_instances,
760 node) { 760 node) {
761 if (instance->trip != trip) 761 if (instance->trip != trip)
762 continue; 762 continue;
@@ -777,7 +777,7 @@ static void thermal_zone_device_passive(struct thermal_zone_device *tz,
777 * and avoid thrashing around the passive trip point. Note that we 777 * and avoid thrashing around the passive trip point. Note that we
778 * assume symmetry. 778 * assume symmetry.
779 */ 779 */
780 list_for_each_entry(instance, &tz->cooling_devices, node) { 780 list_for_each_entry(instance, &tz->thermal_instances, node) {
781 if (instance->trip != trip) 781 if (instance->trip != trip)
782 continue; 782 continue;
783 cdev = instance->cdev; 783 cdev = instance->cdev;
@@ -873,13 +873,13 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
873 goto remove_symbol_link; 873 goto remove_symbol_link;
874 874
875 mutex_lock(&tz->lock); 875 mutex_lock(&tz->lock);
876 list_for_each_entry(pos, &tz->cooling_devices, node) 876 list_for_each_entry(pos, &tz->thermal_instances, node)
877 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { 877 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
878 result = -EEXIST; 878 result = -EEXIST;
879 break; 879 break;
880 } 880 }
881 if (!result) 881 if (!result)
882 list_add_tail(&dev->node, &tz->cooling_devices); 882 list_add_tail(&dev->node, &tz->thermal_instances);
883 mutex_unlock(&tz->lock); 883 mutex_unlock(&tz->lock);
884 884
885 if (!result) 885 if (!result)
@@ -912,7 +912,7 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
912 struct thermal_instance *pos, *next; 912 struct thermal_instance *pos, *next;
913 913
914 mutex_lock(&tz->lock); 914 mutex_lock(&tz->lock);
915 list_for_each_entry_safe(pos, next, &tz->cooling_devices, node) { 915 list_for_each_entry_safe(pos, next, &tz->thermal_instances, node) {
916 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { 916 if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
917 list_del(&pos->node); 917 list_del(&pos->node);
918 mutex_unlock(&tz->lock); 918 mutex_unlock(&tz->lock);
@@ -1117,7 +1117,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
1117 } 1117 }
1118 1118
1119 if (temp >= trip_temp) { 1119 if (temp >= trip_temp) {
1120 list_for_each_entry(instance, &tz->cooling_devices, node) { 1120 list_for_each_entry(instance, &tz->thermal_instances, node) {
1121 if (instance->trip != trip) 1121 if (instance->trip != trip)
1122 continue; 1122 continue;
1123 1123
@@ -1136,7 +1136,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
1136 cdev->ops->set_cur_state(cdev, cur_state); 1136 cdev->ops->set_cur_state(cdev, cur_state);
1137 } 1137 }
1138 } else { /* below trip */ 1138 } else { /* below trip */
1139 list_for_each_entry(instance, &tz->cooling_devices, node) { 1139 list_for_each_entry(instance, &tz->thermal_instances, node) {
1140 if (instance->trip != trip) 1140 if (instance->trip != trip)
1141 continue; 1141 continue;
1142 1142
@@ -1365,7 +1365,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
1365 if (!tz) 1365 if (!tz)
1366 return ERR_PTR(-ENOMEM); 1366 return ERR_PTR(-ENOMEM);
1367 1367
1368 INIT_LIST_HEAD(&tz->cooling_devices); 1368 INIT_LIST_HEAD(&tz->thermal_instances);
1369 idr_init(&tz->idr); 1369 idr_init(&tz->idr);
1370 mutex_init(&tz->lock); 1370 mutex_init(&tz->lock);
1371 result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); 1371 result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 38267a595d69..cb0b0e3ffd97 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -122,9 +122,9 @@ struct thermal_zone_device {
122 bool passive; 122 bool passive;
123 unsigned int forced_passive; 123 unsigned int forced_passive;
124 const struct thermal_zone_device_ops *ops; 124 const struct thermal_zone_device_ops *ops;
125 struct list_head cooling_devices; 125 struct list_head thermal_instances;
126 struct idr idr; 126 struct idr idr;
127 struct mutex lock; /* protect cooling devices list */ 127 struct mutex lock; /* protect thermal_instances list */
128 struct list_head node; 128 struct list_head node;
129 struct delayed_work poll_queue; 129 struct delayed_work poll_queue;
130}; 130};