Thread (9 messages) 9 messages, 4 authors, 2026-08-30

[PATCH v2 2/2] hwmon: (lm90) Reject channel 2 on chips with only one remote sensor

flat view
COLD44d IN LINUX-NEXT

From: Flaviu Nistor <hidden>
Date: 2026-08-26 18:48:10
Also in: linux-hwmon, lkml
Subsystem: hardware monitoring, lm90 hardware monitor driver, the rest · Maintainers: Guenter Roeck, Jean Delvare, Linus Torvalds

Revision v2 of 2 in this series; queued in linux-next as c56e8aa0f9c7 on 2026-09-29.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current
Validate firmware channel definitions against chip capabilities and return
-EINVAL when channel 2 is configured on devices with 1 remote channel.

Signed-off-by: Flaviu Nistor <redacted>
---
 drivers/hwmon/lm90.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 1c603272538a..3faeb2c6ab01 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -2712,6 +2712,11 @@ static int lm90_probe_channel(struct i2c_client *client,
 		return -EINVAL;
 	}
 
+	if (id == 2 && !(data->flags & LM90_HAVE_TEMP3)) {
+		dev_err(dev, "channel %d is not supported for this chip in %pfw\n", id, child);
+		return -EINVAL;
+	}
+
 	err = fwnode_property_read_string(child, "label", &data->channel_label[id]);
 	if (err == -ENODATA || err == -EILSEQ) {
 		dev_err(dev, "invalid label property in %pfw\n", child);
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help