diff options
author | Joel Stanley <joel@jms.id.au> | 2022-03-08 10:48:37 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2022-03-08 10:48:40 +0300 |
commit | c4c3fba61580d267568c5c9cf10c928a41ba38a4 (patch) | |
tree | 96e9f51838e6b792a9d099c7580faeb51eb7d5bd /drivers/hwmon | |
parent | de0980ea2d5360bd1d7472e62231a03c108f20c2 (diff) | |
parent | 8993e6067f263765fd26edabf3e3012e3ec4d81e (diff) | |
download | linux-c4c3fba61580d267568c5c9cf10c928a41ba38a4.tar.xz |
Merge tag 'v5.15.26' into dev-5.15
This is the 5.15.26 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/hwmon.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 3501a3ead4ba..3ae961986fc3 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -214,12 +214,14 @@ static int hwmon_thermal_add_sensor(struct device *dev, int index) tzd = devm_thermal_zone_of_sensor_register(dev, index, tdata, &hwmon_thermal_ops); - /* - * If CONFIG_THERMAL_OF is disabled, this returns -ENODEV, - * so ignore that error but forward any other error. - */ - if (IS_ERR(tzd) && (PTR_ERR(tzd) != -ENODEV)) - return PTR_ERR(tzd); + if (IS_ERR(tzd)) { + if (PTR_ERR(tzd) != -ENODEV) + return PTR_ERR(tzd); + dev_info(dev, "temp%d_input not attached to any thermal zone\n", + index + 1); + devm_kfree(dev, tdata); + return 0; + } err = devm_add_action(dev, hwmon_thermal_remove_sensor, &tdata->node); if (err) |