Commit 6af5f7b6 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: core_env: Do not pass number of modules as argument

The number of modules can be resolved from the first argument, so do not
pass it.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5c759fe2
...@@ -661,13 +661,12 @@ static int mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core, ...@@ -661,13 +661,12 @@ static int mlxsw_env_temp_event_set(struct mlxsw_core *mlxsw_core,
return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtmp), mtmp_pl); return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtmp), mtmp_pl);
} }
static int mlxsw_env_module_temp_event_enable(struct mlxsw_core *mlxsw_core, static int mlxsw_env_module_temp_event_enable(struct mlxsw_core *mlxsw_core)
u8 module_count)
{ {
int i, err, sensor_index; int i, err, sensor_index;
bool has_temp_sensor; bool has_temp_sensor;
for (i = 0; i < module_count; i++) { for (i = 0; i < mlxsw_core_env(mlxsw_core)->module_count; i++) {
err = mlxsw_env_module_has_temp_sensor(mlxsw_core, i, err = mlxsw_env_module_has_temp_sensor(mlxsw_core, i,
&has_temp_sensor); &has_temp_sensor);
if (err) if (err)
...@@ -876,12 +875,11 @@ mlxsw_env_module_plug_event_unregister(struct mlxsw_env *mlxsw_env) ...@@ -876,12 +875,11 @@ mlxsw_env_module_plug_event_unregister(struct mlxsw_env *mlxsw_env)
} }
static int static int
mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core, mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core)
u8 module_count)
{ {
int i, err; int i, err;
for (i = 0; i < module_count; i++) { for (i = 0; i < mlxsw_core_env(mlxsw_core)->module_count; i++) {
char pmaos_pl[MLXSW_REG_PMAOS_LEN]; char pmaos_pl[MLXSW_REG_PMAOS_LEN];
mlxsw_reg_pmaos_pack(pmaos_pl, i); mlxsw_reg_pmaos_pack(pmaos_pl, i);
...@@ -1037,12 +1035,11 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env) ...@@ -1037,12 +1035,11 @@ int mlxsw_env_init(struct mlxsw_core *mlxsw_core, struct mlxsw_env **p_env)
if (err) if (err)
goto err_module_plug_event_register; goto err_module_plug_event_register;
err = mlxsw_env_module_oper_state_event_enable(mlxsw_core, err = mlxsw_env_module_oper_state_event_enable(mlxsw_core);
env->module_count);
if (err) if (err)
goto err_oper_state_event_enable; goto err_oper_state_event_enable;
err = mlxsw_env_module_temp_event_enable(mlxsw_core, env->module_count); err = mlxsw_env_module_temp_event_enable(mlxsw_core);
if (err) if (err)
goto err_temp_event_enable; goto err_temp_event_enable;
......
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