thermal: rename thermal_zone_device.cooling_devices to thermal_zone_device.instances
Zhang Rui
reviewerRFC PATCH 8/12 thermal: rename thermal_zone_device.cooling_devices to thermal_zone_device.instances
Rename
thermal_zone_device.cooling_devices to thermal_zone_device.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 <[email protected]>
--- drivers/thermal/thermal_sys.c | 18 +++++++++--------- include/linux/thermal.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/thermal/thermal_sys.c +9 -9
@@ -704,7 +704,7 @@ static void thermal_zone_device_passive(/* Heating up? */ if (trend >0 ) { -list_for_each_entry (instance, &tz->cooling_devices, +list_for_each_entry (instance, &tz->instances, node) {if (instance->trip != trip)continue ;
@@ -715,7 +715,7 @@ static void thermal_zone_device_passive( cdev->ops->set_cur_state (cdev, state); } }else if (trend <0 ) {/* Cooling off? */ -list_for_each_entry (instance, &tz->cooling_devices, +list_for_each_entry (instance, &tz->instances, node) {if (instance->trip != trip)continue ;
@@ -736,7 +736,7 @@ static void thermal_zone_device_passive(* and avoid thrashing around the passive trip point. Note that we * assume symmetry. */ -list_for_each_entry (instance, &tz->cooling_devices, node) { +list_for_each_entry (instance, &tz->instances, node) {if (instance->trip != trip)continue ; cdev = instance->cdev;
@@ -833,13 +833,13 @@ int thermal_zone_bind_cooling_device(str goto remove_symbol_link;mutex_lock (&tz->lock); -list_for_each_entry (pos, &tz->cooling_devices, node) +list_for_each_entry (pos, &tz->instances, node)if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { result = -EEXIST ;break ; }if (!result) -list_add_tail (&dev->node, &tz->cooling_devices); +list_add_tail (&dev->node, &tz->instances);mutex_unlock (&tz->lock);if (!result)
@@ -872,7 +872,7 @@ int thermal_zone_unbind_cooling_device(sstruct thermal_instance *pos, *next;mutex_lock (&tz->lock); -list_for_each_entry_safe (pos, next, &tz->cooling_devices, node) { +list_for_each_entry_safe (pos, next, &tz->instances, node) {if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {list_del (&pos->node);mutex_unlock (&tz->lock);
@@ -1066,7 +1066,7 @@ static void thermal_zone_trip_update(strif (temp >= trip_temp) {thermal_get_trend (tz, trip, &trend); -list_for_each_entry (instance, &tz->cooling_devices, node) { +list_for_each_entry (instance, &tz->instances, node) {if (instance->trip != trip)continue ;
@@ -1085,7 +1085,7 @@ static void thermal_zone_trip_update(str cdev->ops->set_cur_state (cdev, cur_state); } }else {/* below trip */ -list_for_each_entry (instance, &tz->cooling_devices, node) { +list_for_each_entry (instance, &tz->instances, node) {if (instance->trip != trip)continue ;
@@ -1210,7 +1210,7 @@ struct thermal_zone_device *thermal_zoneif (!tz)return ERR_PTR (-ENOMEM ); -INIT_LIST_HEAD (&tz->cooling_devices); +INIT_LIST_HEAD (&tz->instances);idr_init (&tz->idr);mutex_init (&tz->lock); result =get_idr (&thermal_tz_idr, &thermal_idr_lock, &tz->id);
include/linux/thermal.h +2 -2
@@ -106,9 +106,9 @@ struct thermal_zone_device {bool passive;unsigned int forced_passive;const struct thermal_zone_device_ops *ops; -struct list_head cooling_devices; +struct list_head instances;struct idr idr; -struct mutex lock;/* protect cooling devices list */ +struct mutex lock;/* protect instances list */ struct list_head node;struct delayed_work poll_queue; };