Commit 74e0494d authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

mlxsw: core: Move basic_trap_groups_set() call out of EMAD init code

The call inits the EMAD group, but other groups as well. Therefore, move
it out of EMAD init code and call it before.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7aad5244
......@@ -212,6 +212,11 @@ struct mlxsw_event_listener_item {
void *priv;
};
static int mlxsw_core_trap_groups_set(struct mlxsw_core *mlxsw_core)
{
return mlxsw_core->driver->basic_trap_groups_set(mlxsw_core);
}
/******************
* EMAD processing
******************/
......@@ -777,16 +782,10 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
if (err)
goto err_trap_register;
err = mlxsw_core->driver->basic_trap_groups_set(mlxsw_core);
if (err)
goto err_emad_trap_set;
mlxsw_core->emad.use_emad = true;
return 0;
err_emad_trap_set:
mlxsw_core_trap_unregister(mlxsw_core, &mlxsw_emad_rx_listener,
mlxsw_core);
err_trap_register:
destroy_workqueue(mlxsw_core->emad_wq);
return err;
......@@ -2122,6 +2121,10 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
}
}
err = mlxsw_core_trap_groups_set(mlxsw_core);
if (err)
goto err_trap_groups_set;
err = mlxsw_emad_init(mlxsw_core);
if (err)
goto err_emad_init;
......@@ -2181,6 +2184,7 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
err_register_params:
mlxsw_emad_fini(mlxsw_core);
err_emad_init:
err_trap_groups_set:
kfree(mlxsw_core->lag.mapping);
err_alloc_lag_mapping:
mlxsw_ports_fini(mlxsw_core, reload);
......
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