From: Archit More <architmore303@gmail.com>
To: Juerg Haefliger <juergh@proton.me>, Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Archit More <architmore303@gmail.com>
Subject: [PATCH] hwmon: (dme1737) Use str_yes_no() helper in dme1737_init_device()
Date: Mon, 9 Nov 2026 17:41:27 +0530 [thread overview]
Message-ID: <20261109121127.10937-1-architmore303@gmail.com> (raw)
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
reply other threads:[~2026-11-09 12:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261109121127.10937-1-architmore303@gmail.com \
--to=architmore303@gmail.com \
--cc=juergh@proton.me \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®