summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp421.c
diff options
context:
space:
mode:
authorKrzysztof Adamski <krzysztof.adamski@nokia.com>2021-10-14 15:11:02 +0200
committerGuenter Roeck <linux@roeck-us.net>2021-10-16 00:55:58 +0200
commit3e4dd2e8bcf2780e5d421a5d9e833b6ac4e70b11 (patch)
treef22606ca92a0f623677d83faa7a4d6ffbd7b2bb2 /drivers/hwmon/tmp421.c
parenthwmon: (tmp421) update documentation (diff)
downloadlinux-3e4dd2e8bcf2780e5d421a5d9e833b6ac4e70b11.tar.xz
linux-3e4dd2e8bcf2780e5d421a5d9e833b6ac4e70b11.zip
hwmon: (tmp421) ignore non-channel related DT nodes
In case the DT contains some nodes not describing the input channels, ignore them instead of exiting with error. Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/8e9e332b18dc2cf545f8e8255157e408d356f916.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/tmp421.c')
-rw-r--r--drivers/hwmon/tmp421.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index 277628e2a510..31e95b5749c8 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;