@@ -328,7 +328,6 @@ static void mlxsw_m_port_module_unmap(struct mlxsw_m *mlxsw_m, u8 module)
328
328
static int mlxsw_m_ports_create (struct mlxsw_m * mlxsw_m )
329
329
{
330
330
unsigned int max_ports = mlxsw_core_max_ports (mlxsw_m -> core );
331
- struct devlink * devlink = priv_to_devlink (mlxsw_m -> core );
332
331
u8 last_module = max_ports ;
333
332
int i ;
334
333
int err ;
@@ -357,7 +356,6 @@ static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m)
357
356
}
358
357
359
358
/* Create port objects for each valid entry */
360
- devl_lock (devlink );
361
359
for (i = 0 ; i < mlxsw_m -> max_ports ; i ++ ) {
362
360
if (mlxsw_m -> module_to_port [i ] > 0 ) {
363
361
err = mlxsw_m_port_create (mlxsw_m ,
@@ -367,7 +365,6 @@ static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m)
367
365
goto err_module_to_port_create ;
368
366
}
369
367
}
370
- devl_unlock (devlink );
371
368
372
369
return 0 ;
373
370
@@ -377,7 +374,6 @@ static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m)
377
374
mlxsw_m_port_remove (mlxsw_m ,
378
375
mlxsw_m -> module_to_port [i ]);
379
376
}
380
- devl_unlock (devlink );
381
377
i = max_ports ;
382
378
err_module_to_port_map :
383
379
for (i -- ; i > 0 ; i -- )
@@ -390,18 +386,15 @@ static int mlxsw_m_ports_create(struct mlxsw_m *mlxsw_m)
390
386
391
387
static void mlxsw_m_ports_remove (struct mlxsw_m * mlxsw_m )
392
388
{
393
- struct devlink * devlink = priv_to_devlink (mlxsw_m -> core );
394
389
int i ;
395
390
396
- devl_lock (devlink );
397
391
for (i = 0 ; i < mlxsw_m -> max_ports ; i ++ ) {
398
392
if (mlxsw_m -> module_to_port [i ] > 0 ) {
399
393
mlxsw_m_port_remove (mlxsw_m ,
400
394
mlxsw_m -> module_to_port [i ]);
401
395
mlxsw_m_port_module_unmap (mlxsw_m , i );
402
396
}
403
397
}
404
- devl_unlock (devlink );
405
398
406
399
kfree (mlxsw_m -> module_to_port );
407
400
kfree (mlxsw_m -> ports );
0 commit comments