* [PATCH] hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device()
@ 2026-11-09 12:11 Archit More
0 siblings, 0 replies; only message in thread
From: Archit More @ 2026-11-09 12:11 UTC (permalink / raw)
To: Juerg Haefliger, Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Archit More
Replace open-coded ternary string choices ("yes" / "no") with the
standard str_yes_no() helper from <linux/string_choices.h>.
Signed-off-by: Archit More <architmore303@gmail.com>
---
drivers/hwmon/dme1737.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index b1bd3682c5fb..c3bf5f4ef941 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
@@ -2316,13 +2317,13 @@ static int dme1737_init_device(struct device *dev)
dev_info(dev,
"Optional features: pwm3=%s, pwm5=%s, pwm6=%s, fan3=%s, fan4=%s, fan5=%s, fan6=%s.\n",
- (data->has_features & HAS_PWM(2)) ? "yes" : "no",
- (data->has_features & HAS_PWM(4)) ? "yes" : "no",
- (data->has_features & HAS_PWM(5)) ? "yes" : "no",
- (data->has_features & HAS_FAN(2)) ? "yes" : "no",
- (data->has_features & HAS_FAN(3)) ? "yes" : "no",
- (data->has_features & HAS_FAN(4)) ? "yes" : "no",
- (data->has_features & HAS_FAN(5)) ? "yes" : "no");
+ str_yes_no(data->has_features & HAS_PWM(2)),
+ str_yes_no(data->has_features & HAS_PWM(4)),
+ str_yes_no(data->has_features & HAS_PWM(5)),
+ str_yes_no(data->has_features & HAS_FAN(2)),
+ str_yes_no(data->has_features & HAS_FAN(3)),
+ str_yes_no(data->has_features & HAS_FAN(4)),
+ str_yes_no(data->has_features & HAS_FAN(5)));
reg = dme1737_read(data, DME1737_REG_TACH_PWM);
/* Inform if fan-to-pwm mapping differs from the default */
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-09 12:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 12:11 [PATCH] hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device() Archit More
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®