]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: core: Use different get_trend() callbacks for different thermal zones
authorVadim Pasternak <vadimp@mellanox.com>
Sun, 7 Jun 2020 08:10:27 +0000 (11:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Jun 2020 23:59:43 +0000 (16:59 -0700)
commit55c2c3c06d385f1d811f48e830ba780f54cdcaa0
tree64f42e45224a11f3b1fe0980af14b72b52195026
parent11b84b5b438655771fd296e33dfc42192fb9bad1
mlxsw: core: Use different get_trend() callbacks for different thermal zones

The driver registers three different types of thermal zones: For the
ASIC itself, for port modules and for gearboxes.

Currently, all three types use the same get_trend() callback which does
not work correctly for the ASIC thermal zone. The callback assumes that
the device data is of type 'struct mlxsw_thermal_module', whereas for
the ASIC thermal zone 'struct mlxsw_thermal' is passed as device data.

Fix this by using one get_trend() callback for the ASIC thermal zone and
another for the other two types.

Fixes: d67b5b7ce043 ("mlxsw: core: Add the hottest thermal zone detection")
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c