Skip to content

Commit 8f4ebdb

Browse files
idoschdavem330
authored andcommitted
mlxsw: Make PMAOS pack function more generic
The PMAOS register has enable bits (e.g., PMAOS.ee) that allow changing only a subset of the fields, which is exactly what subsequent patches will need to do. Instead of passing multiple arguments to its pack function, only pass the module index and let the rest be set by the different callers. No functional changes intended. Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ef23841 commit 8f4ebdb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_env.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,10 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core,
684684
for (i = 0; i < module_count; i++) {
685685
char pmaos_pl[MLXSW_REG_PMAOS_LEN];
686686

687-
mlxsw_reg_pmaos_pack(pmaos_pl, i,
688-
MLXSW_REG_PMAOS_E_GENERATE_EVENT);
687+
mlxsw_reg_pmaos_pack(pmaos_pl, i);
688+
mlxsw_reg_pmaos_e_set(pmaos_pl,
689+
MLXSW_REG_PMAOS_E_GENERATE_EVENT);
690+
mlxsw_reg_pmaos_ee_set(pmaos_pl, true);
689691
err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl);
690692
if (err)
691693
return err;

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5747,13 +5747,10 @@ enum mlxsw_reg_pmaos_e {
57475747
*/
57485748
MLXSW_ITEM32(reg, pmaos, e, 0x04, 0, 2);
57495749

5750-
static inline void mlxsw_reg_pmaos_pack(char *payload, u8 module,
5751-
enum mlxsw_reg_pmaos_e e)
5750+
static inline void mlxsw_reg_pmaos_pack(char *payload, u8 module)
57525751
{
57535752
MLXSW_REG_ZERO(pmaos, payload);
57545753
mlxsw_reg_pmaos_module_set(payload, module);
5755-
mlxsw_reg_pmaos_e_set(payload, e);
5756-
mlxsw_reg_pmaos_ee_set(payload, true);
57575754
}
57585755

57595756
/* PPLR - Port Physical Loopback Register

0 commit comments

Comments
 (0)