All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed
@ 2026-06-12 21:53 Rob Herring (Arm)
  2026-06-12 22:00 ` sashiko-bot
  2026-06-13 12:53 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring (Arm) @ 2026-06-12 21:53 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed
  2026-06-12 21:53 [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed Rob Herring (Arm)
@ 2026-06-12 22:00 ` sashiko-bot
  2026-06-13 12:53 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-06-12 22:00 UTC (permalink / raw)
  Cc: linux-hwmon

> 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>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260612215332.1889497-1-robh@kernel.org?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed
  2026-06-12 21:53 [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed Rob Herring (Arm)
  2026-06-12 22:00 ` sashiko-bot
@ 2026-06-13 12:53 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-06-13 12:53 UTC (permalink / raw)
  To: Rob Herring (Arm); +Cc: linux-hwmon, linux-kernel

On Fri, Jun 12, 2026 at 04:53:32PM -0500, Rob Herring (Arm) wrote:
> 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>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-13 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 21:53 [PATCH] hwmon: tmp401: Read "ti,n-factor" as signed Rob Herring (Arm)
2026-06-12 22:00 ` sashiko-bot
2026-06-13 12:53 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.