Commit 6d94449a authored by Vadim Pasternak's avatar Vadim Pasternak Committed by David S. Miller

mlxsw: core_thermal: Add line card id prefix to line card thermal zone name

Add prefix "lc#n" to thermal zones associated with the thermal objects
found on line cards.

For example thermal zone for module #9 located at line card #7 will
have type:
mlxsw-lc7-module9.
And thermal zone for gearbox #3 located at line card #5 will have type:
mlxsw-lc5-gearbox3.
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef0df4fa
...@@ -685,6 +685,10 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) ...@@ -685,6 +685,10 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz)
char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME];
int err; int err;
if (module_tz->slot_index)
snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d",
module_tz->slot_index, module_tz->module + 1);
else
snprintf(tz_name, sizeof(tz_name), "mlxsw-module%d", snprintf(tz_name, sizeof(tz_name), "mlxsw-module%d",
module_tz->module + 1); module_tz->module + 1);
module_tz->tzdev = thermal_zone_device_register(tz_name, module_tz->tzdev = thermal_zone_device_register(tz_name,
...@@ -820,6 +824,10 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) ...@@ -820,6 +824,10 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz)
char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME]; char tz_name[MLXSW_THERMAL_ZONE_MAX_NAME];
int ret; int ret;
if (gearbox_tz->slot_index)
snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d",
gearbox_tz->slot_index, gearbox_tz->module + 1);
else
snprintf(tz_name, sizeof(tz_name), "mlxsw-gearbox%d", snprintf(tz_name, sizeof(tz_name), "mlxsw-gearbox%d",
gearbox_tz->module + 1); gearbox_tz->module + 1);
gearbox_tz->tzdev = thermal_zone_device_register(tz_name, gearbox_tz->tzdev = thermal_zone_device_register(tz_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment