@@ -57,14 +57,14 @@ static ssize_t mlxsw_hwmon_temp_show(struct device *dev,
57
57
struct device_attribute * attr ,
58
58
char * buf )
59
59
{
60
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
60
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
61
61
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
62
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
62
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
63
63
char mtmp_pl [MLXSW_REG_MTMP_LEN ];
64
64
int temp , index ;
65
65
int err ;
66
66
67
- index = mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr -> type_index ,
67
+ index = mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr -> type_index ,
68
68
mlxsw_hwmon -> module_sensor_max );
69
69
mlxsw_reg_mtmp_pack (mtmp_pl , index , false, false);
70
70
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mtmp ), mtmp_pl );
@@ -80,14 +80,14 @@ static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev,
80
80
struct device_attribute * attr ,
81
81
char * buf )
82
82
{
83
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
83
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
84
84
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
85
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
85
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
86
86
char mtmp_pl [MLXSW_REG_MTMP_LEN ];
87
87
int temp_max , index ;
88
88
int err ;
89
89
90
- index = mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr -> type_index ,
90
+ index = mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr -> type_index ,
91
91
mlxsw_hwmon -> module_sensor_max );
92
92
mlxsw_reg_mtmp_pack (mtmp_pl , index , false, false);
93
93
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mtmp ), mtmp_pl );
@@ -103,9 +103,9 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,
103
103
struct device_attribute * attr ,
104
104
const char * buf , size_t len )
105
105
{
106
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
106
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
107
107
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
108
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
108
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
109
109
char mtmp_pl [MLXSW_REG_MTMP_LEN ] = {0 };
110
110
unsigned long val ;
111
111
int index ;
@@ -117,7 +117,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,
117
117
if (val != 1 )
118
118
return - EINVAL ;
119
119
120
- index = mlxsw_hwmon_get_attr_index (mlwsw_hwmon_attr -> type_index ,
120
+ index = mlxsw_hwmon_get_attr_index (mlxsw_hwmon_attr -> type_index ,
121
121
mlxsw_hwmon -> module_sensor_max );
122
122
123
123
mlxsw_reg_mtmp_sensor_index_set (mtmp_pl , index );
@@ -138,13 +138,13 @@ static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev,
138
138
struct device_attribute * attr ,
139
139
char * buf )
140
140
{
141
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
141
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
142
142
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
143
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
143
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
144
144
char mfsm_pl [MLXSW_REG_MFSM_LEN ];
145
145
int err ;
146
146
147
- mlxsw_reg_mfsm_pack (mfsm_pl , mlwsw_hwmon_attr -> type_index );
147
+ mlxsw_reg_mfsm_pack (mfsm_pl , mlxsw_hwmon_attr -> type_index );
148
148
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mfsm ), mfsm_pl );
149
149
if (err ) {
150
150
dev_err (mlxsw_hwmon -> bus_info -> dev , "Failed to query fan\n" );
@@ -157,9 +157,9 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev,
157
157
struct device_attribute * attr ,
158
158
char * buf )
159
159
{
160
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
160
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
161
161
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
162
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
162
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
163
163
char fore_pl [MLXSW_REG_FORE_LEN ];
164
164
bool fault ;
165
165
int err ;
@@ -169,7 +169,7 @@ static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev,
169
169
dev_err (mlxsw_hwmon -> bus_info -> dev , "Failed to query fan\n" );
170
170
return err ;
171
171
}
172
- mlxsw_reg_fore_unpack (fore_pl , mlwsw_hwmon_attr -> type_index , & fault );
172
+ mlxsw_reg_fore_unpack (fore_pl , mlxsw_hwmon_attr -> type_index , & fault );
173
173
174
174
return sprintf (buf , "%u\n" , fault );
175
175
}
@@ -178,13 +178,13 @@ static ssize_t mlxsw_hwmon_pwm_show(struct device *dev,
178
178
struct device_attribute * attr ,
179
179
char * buf )
180
180
{
181
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
181
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
182
182
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
183
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
183
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
184
184
char mfsc_pl [MLXSW_REG_MFSC_LEN ];
185
185
int err ;
186
186
187
- mlxsw_reg_mfsc_pack (mfsc_pl , mlwsw_hwmon_attr -> type_index , 0 );
187
+ mlxsw_reg_mfsc_pack (mfsc_pl , mlxsw_hwmon_attr -> type_index , 0 );
188
188
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mfsc ), mfsc_pl );
189
189
if (err ) {
190
190
dev_err (mlxsw_hwmon -> bus_info -> dev , "Failed to query PWM\n" );
@@ -198,9 +198,9 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev,
198
198
struct device_attribute * attr ,
199
199
const char * buf , size_t len )
200
200
{
201
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
201
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
202
202
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
203
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
203
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
204
204
char mfsc_pl [MLXSW_REG_MFSC_LEN ];
205
205
unsigned long val ;
206
206
int err ;
@@ -211,7 +211,7 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev,
211
211
if (val > 255 )
212
212
return - EINVAL ;
213
213
214
- mlxsw_reg_mfsc_pack (mfsc_pl , mlwsw_hwmon_attr -> type_index , val );
214
+ mlxsw_reg_mfsc_pack (mfsc_pl , mlxsw_hwmon_attr -> type_index , val );
215
215
err = mlxsw_reg_write (mlxsw_hwmon -> core , MLXSW_REG (mfsc ), mfsc_pl );
216
216
if (err ) {
217
217
dev_err (mlxsw_hwmon -> bus_info -> dev , "Failed to write PWM\n" );
@@ -224,14 +224,14 @@ static int mlxsw_hwmon_module_temp_get(struct device *dev,
224
224
struct device_attribute * attr ,
225
225
int * p_temp )
226
226
{
227
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
227
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
228
228
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
229
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
229
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
230
230
char mtmp_pl [MLXSW_REG_MTMP_LEN ];
231
231
u8 module ;
232
232
int err ;
233
233
234
- module = mlwsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
234
+ module = mlxsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
235
235
mlxsw_reg_mtmp_pack (mtmp_pl , MLXSW_REG_MTMP_MODULE_INDEX_MIN + module ,
236
236
false, false);
237
237
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mtmp ), mtmp_pl );
@@ -261,15 +261,15 @@ static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev,
261
261
struct device_attribute * attr ,
262
262
char * buf )
263
263
{
264
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
264
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
265
265
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
266
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
266
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
267
267
char mtbr_pl [MLXSW_REG_MTBR_LEN ] = {0 };
268
268
u8 module , fault ;
269
269
u16 temp ;
270
270
int err ;
271
271
272
- module = mlwsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
272
+ module = mlxsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
273
273
mlxsw_reg_mtbr_pack (mtbr_pl , MLXSW_REG_MTBR_BASE_MODULE_INDEX + module ,
274
274
1 );
275
275
err = mlxsw_reg_query (mlxsw_hwmon -> core , MLXSW_REG (mtbr ), mtbr_pl );
@@ -303,13 +303,13 @@ static int mlxsw_hwmon_module_temp_critical_get(struct device *dev,
303
303
struct device_attribute * attr ,
304
304
int * p_temp )
305
305
{
306
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
306
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
307
307
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
308
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
308
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
309
309
u8 module ;
310
310
int err ;
311
311
312
- module = mlwsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
312
+ module = mlxsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
313
313
err = mlxsw_env_module_temp_thresholds_get (mlxsw_hwmon -> core , module ,
314
314
SFP_TEMP_HIGH_WARN , p_temp );
315
315
if (err ) {
@@ -337,13 +337,13 @@ static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev,
337
337
struct device_attribute * attr ,
338
338
int * p_temp )
339
339
{
340
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
340
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
341
341
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
342
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
342
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
343
343
u8 module ;
344
344
int err ;
345
345
346
- module = mlwsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
346
+ module = mlxsw_hwmon_attr -> type_index - mlxsw_hwmon -> sensor_count ;
347
347
err = mlxsw_env_module_temp_thresholds_get (mlxsw_hwmon -> core , module ,
348
348
SFP_TEMP_HIGH_ALARM , p_temp );
349
349
if (err ) {
@@ -373,22 +373,22 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev,
373
373
struct device_attribute * attr ,
374
374
char * buf )
375
375
{
376
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
376
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
377
377
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
378
378
379
379
return sprintf (buf , "front panel %03u\n" ,
380
- mlwsw_hwmon_attr -> type_index );
380
+ mlxsw_hwmon_attr -> type_index );
381
381
}
382
382
383
383
static ssize_t
384
384
mlxsw_hwmon_gbox_temp_label_show (struct device * dev ,
385
385
struct device_attribute * attr ,
386
386
char * buf )
387
387
{
388
- struct mlxsw_hwmon_attr * mlwsw_hwmon_attr =
388
+ struct mlxsw_hwmon_attr * mlxsw_hwmon_attr =
389
389
container_of (attr , struct mlxsw_hwmon_attr , dev_attr );
390
- struct mlxsw_hwmon * mlxsw_hwmon = mlwsw_hwmon_attr -> hwmon ;
391
- int index = mlwsw_hwmon_attr -> type_index -
390
+ struct mlxsw_hwmon * mlxsw_hwmon = mlxsw_hwmon_attr -> hwmon ;
391
+ int index = mlxsw_hwmon_attr -> type_index -
392
392
mlxsw_hwmon -> module_sensor_max + 1 ;
393
393
394
394
return sprintf (buf , "gearbox %03u\n" , index );
0 commit comments