@@ -105,9 +105,6 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
instance->target = get_target_state(tz, cdev, percentage,
cur_trip_level);
- mutex_lock(&instance->cdev->lock);
- instance->cdev->updated = false;
- mutex_unlock(&instance->cdev->lock);
thermal_cdev_update(cdev);
}
return 0;
@@ -61,9 +61,6 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
dev_dbg(&instance->cdev->device, "target=%d\n",
(int)instance->target);
- mutex_lock(&instance->cdev->lock);
- instance->cdev->updated = false; /* cdev needs update */
- mutex_unlock(&instance->cdev->lock);
thermal_cdev_update(instance->cdev);
}
@@ -530,9 +530,6 @@ static void allow_maximum_power(struct thermal_zone_device *tz)
continue;
instance->target = 0;
- mutex_lock(&instance->cdev->lock);
- instance->cdev->updated = false;
- mutex_unlock(&instance->cdev->lock);
thermal_cdev_update(instance->cdev);
}
mutex_unlock(&tz->lock);
@@ -164,9 +164,6 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
update_passive_instance(tz, trip_type, -1);
instance->initialized = true;
- mutex_lock(&instance->cdev->lock);
- instance->cdev->updated = false; /* cdev needs update */
- mutex_unlock(&instance->cdev->lock);
thermal_cdev_update(instance->cdev);
}
@@ -614,9 +614,6 @@ int power_actor_set_power(struct thermal_cooling_device *cdev,
return ret;
instance->target = state;
- mutex_lock(&cdev->lock);
- cdev->updated = false;
- mutex_unlock(&cdev->lock);
thermal_cdev_update(cdev);
return 0;
@@ -990,7 +987,6 @@ __thermal_cooling_device_register(struct device_node *np,
INIT_LIST_HEAD(&cdev->thermal_instances);
cdev->np = np;
cdev->ops = ops;
- cdev->updated = false;
cdev->device.class = &thermal_class;
cdev->devdata = devdata;
thermal_cooling_device_setup_sysfs(cdev);
@@ -180,11 +180,6 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
unsigned long target = 0;
mutex_lock(&cdev->lock);
- /* cooling device is updated*/
- if (cdev->updated) {
- mutex_unlock(&cdev->lock);
- return;
- }
/* Make sure cdev enters the deepest cooling state */
list_for_each_entry(instance, &cdev->thermal_instances, cdev_node) {
@@ -199,7 +194,6 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
if (!cdev->ops->set_cur_state(cdev, target))
thermal_cooling_device_stats_update(cdev, target);
- cdev->updated = true;
mutex_unlock(&cdev->lock);
trace_cdev_update(cdev, target);
dev_dbg(&cdev->device, "set to state %lu\n", target);
@@ -114,7 +114,6 @@ struct thermal_cooling_device {
void *devdata;
void *stats;
const struct thermal_cooling_device_ops *ops;
- bool updated; /* true if the cooling device does not need update */
struct mutex lock; /* protect thermal_instances list */
struct list_head thermal_instances;
struct list_head node;
The sequence to update the cooling state in the thermal instances is always: mutex_lock(&instance->cdev->lock); instance->cdev->updated = false; mutex_unlock(&instance->cdev->lock); thermal_cdev_update(instance->cdev); So each call to thermal_cdev_update() is prefixed by resetting the updated flag which turns on to be a pointless test in the function itself. Remove the flag. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/thermal/fair_share.c | 3 --- drivers/thermal/gov_bang_bang.c | 3 --- drivers/thermal/power_allocator.c | 3 --- drivers/thermal/step_wise.c | 3 --- drivers/thermal/thermal_core.c | 4 ---- drivers/thermal/thermal_helpers.c | 6 ------ include/linux/thermal.h | 1 - 7 files changed, 23 deletions(-)