diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index d69f1bde1795..af13408c62f9 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -1524,7 +1524,12 @@ static int pmbus_thermal_add_sensor(struct pmbus_data *pmbus_data, tdata->sensor = sensor; tdata->pmbus_data = pmbus_data; - tzd = devm_thermal_of_zone_register(dev, index, tdata, + /* + * The PMBus core numbers its temperature sensors from 1, as the + * hwmon tempN attributes, while the thermal core expects a 0-based + * sensor index. + */ + tzd = devm_thermal_of_zone_register(dev, index - 1, tdata, &pmbus_thermal_ops); /* * If CONFIG_THERMAL_OF is disabled, this returns -ENODEV,