@@ -26,8 +26,8 @@ struct mlxsw_env {
26
26
static int mlxsw_env_validate_cable_ident (struct mlxsw_core * core , int id ,
27
27
bool * qsfp , bool * cmis )
28
28
{
29
- char eeprom_tmp [MLXSW_REG_MCIA_EEPROM_SIZE ];
30
29
char mcia_pl [MLXSW_REG_MCIA_LEN ];
30
+ char * eeprom_tmp ;
31
31
u8 ident ;
32
32
int err ;
33
33
@@ -36,7 +36,7 @@ static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id,
36
36
err = mlxsw_reg_query (core , MLXSW_REG (mcia ), mcia_pl );
37
37
if (err )
38
38
return err ;
39
- mlxsw_reg_mcia_eeprom_memcpy_from (mcia_pl , eeprom_tmp );
39
+ eeprom_tmp = mlxsw_reg_mcia_eeprom_data (mcia_pl );
40
40
ident = eeprom_tmp [0 ];
41
41
* cmis = false;
42
42
switch (ident ) {
@@ -64,8 +64,8 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module,
64
64
u16 offset , u16 size , void * data ,
65
65
bool qsfp , unsigned int * p_read_size )
66
66
{
67
- char eeprom_tmp [MLXSW_REG_MCIA_EEPROM_SIZE ];
68
67
char mcia_pl [MLXSW_REG_MCIA_LEN ];
68
+ char * eeprom_tmp ;
69
69
u16 i2c_addr ;
70
70
u8 page = 0 ;
71
71
int status ;
@@ -116,7 +116,7 @@ mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module,
116
116
if (status )
117
117
return - EIO ;
118
118
119
- mlxsw_reg_mcia_eeprom_memcpy_from (mcia_pl , eeprom_tmp );
119
+ eeprom_tmp = mlxsw_reg_mcia_eeprom_data (mcia_pl );
120
120
memcpy (data , eeprom_tmp , size );
121
121
* p_read_size = size ;
122
122
@@ -127,13 +127,13 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module,
127
127
int off , int * temp )
128
128
{
129
129
unsigned int module_temp , module_crit , module_emerg ;
130
- char eeprom_tmp [MLXSW_REG_MCIA_EEPROM_SIZE ];
131
130
union {
132
131
u8 buf [MLXSW_REG_MCIA_TH_ITEM_SIZE ];
133
132
u16 temp ;
134
133
} temp_thresh ;
135
134
char mcia_pl [MLXSW_REG_MCIA_LEN ] = {0 };
136
135
char mtmp_pl [MLXSW_REG_MTMP_LEN ];
136
+ char * eeprom_tmp ;
137
137
bool qsfp , cmis ;
138
138
int page ;
139
139
int err ;
@@ -195,7 +195,7 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module,
195
195
if (err )
196
196
return err ;
197
197
198
- mlxsw_reg_mcia_eeprom_memcpy_from (mcia_pl , eeprom_tmp );
198
+ eeprom_tmp = mlxsw_reg_mcia_eeprom_data (mcia_pl );
199
199
memcpy (temp_thresh .buf , eeprom_tmp , MLXSW_REG_MCIA_TH_ITEM_SIZE );
200
200
* temp = temp_thresh .temp * 1000 ;
201
201
@@ -357,8 +357,8 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module,
357
357
device_addr = page -> offset ;
358
358
359
359
while (bytes_read < page -> length ) {
360
- char eeprom_tmp [MLXSW_REG_MCIA_EEPROM_SIZE ];
361
360
char mcia_pl [MLXSW_REG_MCIA_LEN ];
361
+ char * eeprom_tmp ;
362
362
u8 size ;
363
363
int err ;
364
364
@@ -380,7 +380,7 @@ mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, u8 module,
380
380
if (err )
381
381
return err ;
382
382
383
- mlxsw_reg_mcia_eeprom_memcpy_from (mcia_pl , eeprom_tmp );
383
+ eeprom_tmp = mlxsw_reg_mcia_eeprom_data (mcia_pl );
384
384
memcpy (page -> data + bytes_read , eeprom_tmp , size );
385
385
bytes_read += size ;
386
386
}
0 commit comments