aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/thermal_helpers.c')
-rw-r--r--drivers/thermal/thermal_helpers.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
index 87b1256fa2f2..c94bc824e5d3 100644
--- a/drivers/thermal/thermal_helpers.c
+++ b/drivers/thermal/thermal_helpers.c
@@ -175,6 +175,16 @@ exit:
mutex_unlock(&tz->lock);
}
+static void thermal_cdev_set_cur_state(struct thermal_cooling_device *cdev,
+ int target)
+{
+ if (cdev->ops->set_cur_state(cdev, target))
+ return;
+
+ thermal_notify_cdev_state_update(cdev->id, target);
+ thermal_cooling_device_stats_update(cdev, target);
+}
+
void thermal_cdev_update(struct thermal_cooling_device *cdev)
{
struct thermal_instance *instance;
@@ -197,8 +207,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
target = instance->target;
}
- if (!cdev->ops->set_cur_state(cdev, target))
- thermal_cooling_device_stats_update(cdev, target);
+ thermal_cdev_set_cur_state(cdev, target);
cdev->updated = true;
mutex_unlock(&cdev->lock);