mlxsw: core: Fix temperature sensor index during initialization
authorJiri Pirko <jiri@mellanox.com>
Fri, 11 Dec 2015 17:26:00 +0000 (18:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Dec 2015 05:45:37 +0000 (00:45 -0500)
Sensor index should be passed instead of 0. For now, this does not make
a difference, since there is so far only one temperature sensor
exposed by HW.

Fixes: 89309da39 ("mlxsw: core: Implement temperature hwmon interface")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c

index 913106d..b86db96 100644 (file)
@@ -242,7 +242,7 @@ static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon *mlxsw_hwmon)
        }
        sensor_count = mlxsw_reg_mtcap_sensor_count_get(mtcap_pl);
        for (i = 0; i < sensor_count; i++) {
-               mlxsw_reg_mtmp_pack(mtmp_pl, 0, true, true);
+               mlxsw_reg_mtmp_pack(mtmp_pl, i, true, true);
                err = mlxsw_reg_write(mlxsw_hwmon->core,
                                      MLXSW_REG(mtmp), mtmp_pl);
                if (err) {