From: "Rob Herring (Arm)" <robh@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed
Date: Fri, 12 Jun 2026 16:53:32 -0500 [thread overview]
Message-ID: <20260612215332.1889497-1-robh@kernel.org> (raw)
The "ti,n-factor" binding and examples allow negative correction
values. Reading it as u32 makes the helper type disagree with the
documented signed value and hides real schema mismatches.
Use the signed helper so the DT access matches the s32 value stored by
the driver.
Assisted-by: Codex:gpt-5-5
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
drivers/hwmon/tmp401.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 07f596581c6e..22ff7c66dca0 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -560,7 +560,7 @@ static int tmp401_init_client(struct tmp401_data *data)
return ret;
}
- ret = of_property_read_u32(data->client->dev.of_node, "ti,n-factor", &nfactor);
+ ret = of_property_read_s32(data->client->dev.of_node, "ti,n-factor", &nfactor);
if (!ret) {
if (data->kind == tmp401) {
dev_err(&data->client->dev, "ti,tmp401 does not support n-factor correction\n");
--
2.53.0
next reply other threads:[~2026-06-12 21:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 21:53 Rob Herring (Arm) [this message]
2026-06-12 22:00 ` [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed sashiko-bot
2026-06-13 12:53 ` Guenter Roeck
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=20260612215332.1889497-1-robh@kernel.org \
--to=robh@kernel.org \
--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