mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
hwmon: (pmbus/core) Register the thermal sensors with a 0-based index
Since commit3aa74796cf("hwmon: (pmbus) Register with thermal for PSC_TEMPERATURE") pmbus_core registers each temperature input with the thermal core using its hwmon index as the sensor id. That index starts at 1, so temp1 is registered as sensor 1. The thermal core expects a 0-based id, which is what the hwmon core passes for the drivers that set HWMON_C_REGISTER_TZ: thermal_of matches a thermal-sensors phandle without cells as id 0, so a PMBus device with a single temperature input cannot use #thermal-sensor-cells = <0>. Cc: stable+noautosel@kernel.org # changes the DT-visible sensor id, no in-tree user Fixes:3aa74796cf("hwmon: (pmbus) Register with thermal for PSC_TEMPERATURE") Signed-off-by: Vincent Jardin <vjardin@free.fr> Link: https://patch.msgid.link/20261001-for-upstream-dt-mpq8785-thermal-sensor-cells-v3-1-bfafba9fcc95@free.fr Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
cf8f81babd
commit
d4f272230f
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user