summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-10-05 13:18:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-10-05 13:18:27 +0200
commit8820087ee5e7e15a5b041d02c9585fff16f858e1 (patch)
tree62443ae73ce82ec707f0723ec9b17a3ebdc1f48e
parent1dd72ce0c125110033e65051c9f8b2676e425cfd (diff)
parenta56cc0a8338523f709892696cc229527617c1316 (diff)
downloadlwn-8820087ee5e7e15a5b041d02c9585fff16f858e1.tar.gz
lwn-8820087ee5e7e15a5b041d02c9585fff16f858e1.zip
Merge thermal core material depended on by subsequent changes.
-rw-r--r--drivers/thermal/thermal_trip.c14
-rw-r--r--include/linux/thermal.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c
index a8e92a89b2b8..8c649a899537 100644
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -27,6 +27,20 @@ int for_each_thermal_trip(struct thermal_zone_device *tz,
}
EXPORT_SYMBOL_GPL(for_each_thermal_trip);
+int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
+ int (*cb)(struct thermal_trip *, void *),
+ void *data)
+{
+ int ret;
+
+ mutex_lock(&tz->lock);
+ ret = for_each_thermal_trip(tz, cb, data);
+ mutex_unlock(&tz->lock);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(thermal_zone_for_each_trip);
+
int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
{
return tz->num_trips;
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 6710a4ace992..2bab72149bbf 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -286,6 +286,9 @@ int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id,
int for_each_thermal_trip(struct thermal_zone_device *tz,
int (*cb)(struct thermal_trip *, void *),
void *data);
+int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
+ int (*cb)(struct thermal_trip *, void *),
+ void *data);
int thermal_zone_get_num_trips(struct thermal_zone_device *tz);
int thermal_zone_get_crit_temp(struct thermal_zone_device *tz, int *temp);