summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-04-04 14:59:43 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-04-04 14:59:43 +0200
commit49c7db1f0b4fbc52435c0f042d95c62a56e9be14 (patch)
tree5f0281919f87bf62fc2cc8e23c913ca033d9d87e
parent9e07e3b81807edd356e1f794cffa00a428eff443 (diff)
parent945471425a374e15a0d1a85b35913e1acdcd4a99 (diff)
downloadlinux-49c7db1f0b4fbc52435c0f042d95c62a56e9be14.tar.gz
linux-49c7db1f0b4fbc52435c0f042d95c62a56e9be14.zip
Merge back earlier thermal core updates for 7.1
-rw-r--r--drivers/thermal/devfreq_cooling.c3
-rw-r--r--drivers/thermal/thermal_core.c2
-rw-r--r--drivers/thermal/thermal_sysfs.c7
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index 597e86d16a4e..1c7dffc8d45f 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -472,7 +472,8 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
remove_qos_req:
dev_pm_qos_remove_request(&dfc->req_max_freq);
free_table:
- kfree(dfc->freq_table);
+ if (!dfc->em_pd)
+ kfree(dfc->freq_table);
free_dfc:
kfree(dfc);
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index d1beee9e15f8..267594b96832 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -863,7 +863,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz,
goto free_mem;
dev->id = result;
- sprintf(dev->name, "cdev%d", dev->id);
+ snprintf(dev->name, sizeof(dev->name), "cdev%d", dev->id);
result =
sysfs_create_link(&tz->device.kobj, &cdev->device.kobj, dev->name);
if (result)
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 46b3b2df935c..5eecae13f07d 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -18,6 +18,7 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
+#include <linux/string_choices.h>
#include <linux/jiffies.h>
#include "thermal_core.h"
@@ -56,10 +57,8 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf)
guard(thermal_zone)(tz);
- if (tz->mode == THERMAL_DEVICE_ENABLED)
- return sysfs_emit(buf, "enabled\n");
-
- return sysfs_emit(buf, "disabled\n");
+ return sysfs_emit(buf, "%s\n",
+ str_enabled_disabled(tz->mode == THERMAL_DEVICE_ENABLED));
}
static ssize_t