mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
hwmon: (tmp421) Check error when loading label from dt
Add error checking when loading temperature channel label defined in device tree. Handling of error from of_property_read_string() is inspired by lm90 driver and therefor contain same error string. Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Link: https://lore.kernel.org/r/20251111144406.7489-1-bruno.thomsen@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
71a117d28f
commit
638196d43b
|
|
@ -369,7 +369,11 @@ static int tmp421_probe_child_from_dt(struct i2c_client *client,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
of_property_read_string(child, "label", &data->channel[i].label);
|
||||
err = of_property_read_string(child, "label", &data->channel[i].label);
|
||||
if (err == -ENODATA || err == -EILSEQ) {
|
||||
dev_err(dev, "invalid label property in %pOFn\n", child);
|
||||
return err;
|
||||
}
|
||||
if (data->channel[i].label)
|
||||
data->temp_config[i] |= HWMON_T_LABEL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user