Thread (22 messages) 22 messages, 3 authors, 2021-10-17
STALE1719d LANDED
Revisions (5)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 current

[PATCH v5 8/9] hwmon: (tmp421) ignore non-channel related DT nodes

From: Krzysztof Adamski <hidden>
Date: 2021-10-14 13:11:12
Also in: linux-hwmon
Subsystem: hardware monitoring, the rest · Maintainers: Guenter Roeck, Linus Torvalds

In case the DT contains some nodes not describing the input channels,
ignore them instead of exiting with error.

Signed-off-by: Krzysztof Adamski <redacted>
---
  drivers/hwmon/tmp421.c | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index 2e20c558fcb0..493a24cdfca2 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -414,6 +414,9 @@ static int tmp421_probe_from_dt(struct i2c_client *client, struct tmp421_data *d
  	int err;
  
  	for_each_child_of_node(np, child) {
+		if (strcmp(child->name, "channel"))
+			continue;
+
  		err = tmp421_probe_child_from_dt(client, child, data);
  		if (err)
  			return err;
-- 
2.31.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