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

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: 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 42c9135f
...@@ -357,6 +357,10 @@ static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev, ...@@ -357,6 +357,10 @@ static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev,
return 0; return 0;
} }
static struct thermal_zone_params mlxsw_thermal_params = {
.no_hwmon = true,
};
static struct thermal_zone_device_ops mlxsw_thermal_ops = { static struct thermal_zone_device_ops mlxsw_thermal_ops = {
.bind = mlxsw_thermal_bind, .bind = mlxsw_thermal_bind,
.unbind = mlxsw_thermal_unbind, .unbind = mlxsw_thermal_unbind,
...@@ -678,7 +682,8 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) ...@@ -678,7 +682,8 @@ mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz)
MLXSW_THERMAL_TRIP_MASK, MLXSW_THERMAL_TRIP_MASK,
module_tz, module_tz,
&mlxsw_thermal_module_ops, &mlxsw_thermal_module_ops,
NULL, 0, &mlxsw_thermal_params,
0,
module_tz->parent->polling_delay); module_tz->parent->polling_delay);
if (IS_ERR(module_tz->tzdev)) { if (IS_ERR(module_tz->tzdev)) {
err = PTR_ERR(module_tz->tzdev); err = PTR_ERR(module_tz->tzdev);
...@@ -808,7 +813,7 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz) ...@@ -808,7 +813,7 @@ mlxsw_thermal_gearbox_tz_init(struct mlxsw_thermal_module *gearbox_tz)
MLXSW_THERMAL_TRIP_MASK, MLXSW_THERMAL_TRIP_MASK,
gearbox_tz, gearbox_tz,
&mlxsw_thermal_gearbox_ops, &mlxsw_thermal_gearbox_ops,
NULL, 0, &mlxsw_thermal_params, 0,
gearbox_tz->parent->polling_delay); gearbox_tz->parent->polling_delay);
if (IS_ERR(gearbox_tz->tzdev)) if (IS_ERR(gearbox_tz->tzdev))
return PTR_ERR(gearbox_tz->tzdev); return PTR_ERR(gearbox_tz->tzdev);
...@@ -968,7 +973,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, ...@@ -968,7 +973,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
MLXSW_THERMAL_TRIP_MASK, MLXSW_THERMAL_TRIP_MASK,
thermal, thermal,
&mlxsw_thermal_ops, &mlxsw_thermal_ops,
NULL, 0, &mlxsw_thermal_params, 0,
thermal->polling_delay); thermal->polling_delay);
if (IS_ERR(thermal->tzdev)) { if (IS_ERR(thermal->tzdev)) {
err = PTR_ERR(thermal->tzdev); err = PTR_ERR(thermal->tzdev);
......
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