diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 574d9879bdcf..8fa379d04cd1 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -1532,10 +1532,11 @@ static int pmbus_thermal_add_sensor(struct pmbus_data *pmbus_data, tzd = devm_thermal_of_zone_register(dev, index - 1, tdata, &pmbus_thermal_ops); /* - * If CONFIG_THERMAL_OF is disabled, this returns -ENODEV, - * so ignore that error but forward any other error. + * If CONFIG_THERMAL_OF is disabled, devm_thermal_of_zone_register() + * returns -ENOTSUPP. If no thermal zone is configured for the sensor, + * it returns -ENODEV. Ignore those errors but forward any other error. */ - if (IS_ERR(tzd) && (PTR_ERR(tzd) != -ENODEV)) { + if (IS_ERR(tzd) && PTR_ERR(tzd) != -ENODEV && PTR_ERR(tzd) != -ENOTSUPP) { devm_kfree(dev, tdata); return PTR_ERR(tzd); }