Thread (22 messages) 22 messages, 4 authors, 2021-10-13

Re: [PATCH v4 09/10] hwmon: (tmp421) ignore non-channel related DT nodes

From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-10-12 14:44:31
Also in: linux-hwmon

On 10/12/21 2:30 AM, Krzysztof Adamski wrote:
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>
For my reference:

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
quoted hunk ↗ jump to hunk
---
  drivers/hwmon/tmp421.c | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index 133eca1f2650..d44112fe2a14 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -411,6 +411,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;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help