summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2026-03-11 19:42:14 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-14 14:15:56 +0300
commit2dc1b0dd4bbfa2a27e5432300d1c18eb51c7efed (patch)
tree49cca213360e5b1424c8e4874b8d8751fffbaec0
parent5ddd020b8bd0fb2fdcdc1f8c40513c656a690f80 (diff)
downloadlinux-2dc1b0dd4bbfa2a27e5432300d1c18eb51c7efed.tar.xz
thermal: sysfs: Use str_enabled_disabled() helper in mode_show()
Replace hard-coded strings with the str_enabled_disabled() helper. This unifies the output and helps the linker with deduplication, which may result in a smaller binary. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> [ rjw: Subject and changelog tweaks ] Link: https://patch.msgid.link/20260311164212.405981-3-thorsten.blum@linux.dev Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/thermal/thermal_sysfs.c7
1 files changed, 3 insertions, 4 deletions
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