Skip to content

Commit f8a3688

Browse files
vadimp-nvidiadavem330
authored andcommitted
mlxsw: core_thermal: Avoid creation of virtual hwmon objects by thermal module
The driver registers with both the hwmon and thermal subsystems. Therefore, there is no need for the thermal subsystem to automatically create hwmon entries upon registration of a thermal zone, as this results in duplicate information. Avoid creation of virtual hwmon objects by thermal subsystem by registering a thermal zone with 'no_hwmon' set to 'true'. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 42c9135 commit f8a3688

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev,
357357
return 0;
358358
}
359359

360+
static struct thermal_zone_params mlxsw_thermal_params = {
361+
.no_hwmon = true,
362+
};
363+
360364
static struct thermal_zone_device_ops mlxsw_thermal_ops = {
361365
.bind = mlxsw_thermal_bind,
362366
.unbind = mlxsw_thermal_unbind,
@@ -678,7 +682,8 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz)
678682
MLXSW_THERMAL_TRIP_MASK,
679683
module_tz,
680684
&mlxsw_thermal_module_ops,
681-
NULL, 0,
685+
&mlxsw_thermal_params,
686+
0,
682687
module_tz->parent->polling_delay);
683688
if (IS_ERR(module_tz->tzdev)) {
684689
err = PTR_ERR(module_tz->tzdev);
@@ -808,7 +813,7 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz)
808813
MLXSW_THERMAL_TRIP_MASK,
809814
gearbox_tz,
810815
&mlxsw_thermal_gearbox_ops,
811-
NULL, 0,
816+
&mlxsw_thermal_params, 0,
812817
gearbox_tz->parent->polling_delay);
813818
if (IS_ERR(gearbox_tz->tzdev))
814819
return PTR_ERR(gearbox_tz->tzdev);
@@ -968,7 +973,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
968973
MLXSW_THERMAL_TRIP_MASK,
969974
thermal,
970975
&mlxsw_thermal_ops,
971-
NULL, 0,
976+
&mlxsw_thermal_params, 0,
972977
thermal->polling_delay);
973978
if (IS_ERR(thermal->tzdev)) {
974979
err = PTR_ERR(thermal->tzdev);

0 commit comments

Comments
 (0)