diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 08:44:22 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 08:44:22 +0100 |
| commit | dbbe23c31922ff773a0847a5c1d3c41050fe1c67 (patch) | |
| tree | 27890c30edd249f21bf614f44430575afa3aa6dd /drivers/hwmon/hwmon.c | |
| parent | 83ba9a33b56673263981d5633fd6a96d83dabc21 (diff) | |
| parent | 7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff) | |
| download | linux-dbbe23c31922ff773a0847a5c1d3c41050fe1c67.tar.gz linux-dbbe23c31922ff773a0847a5c1d3c41050fe1c67.tar.bz2 linux-dbbe23c31922ff773a0847a5c1d3c41050fe1c67.zip | |
Merge 5.17-rc6 into staging-next
We need the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon/hwmon.c')
| -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) |
