Skip to content

Commit d5702de

Browse files
dcskidmoJeff Kirsher
authored andcommitted
ixgbe: Remove second instance of lan_id variable
This patch removes the redundant lan_id in the phy struct and uses the bus version. Both variables exist and intend to represent the STATUS register LAN_ID field. However, phy.lan_id is not bit shifted so the phy.lan_id = 0x0 for LAN Id 0 and phy.lan_id = 0x4 for LAN Id 1. Where bus.lan_id is bit shifted so bus.lan_id = 0x0 for LAN Id 0 and bus.lan_id = 0x1 for LAN Id 1. There seems no need for the additional lan_id variable and this should make the code less confusing. Signed-off-by: Donald C Skidmore <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent bc52f95 commit d5702de

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
243243
u16 ext_ability = 0;
244244

245245
if (!hw->phy.phy_semaphore_mask) {
246-
hw->phy.lan_id = IXGBE_READ_REG(hw, IXGBE_STATUS) &
247-
IXGBE_STATUS_LAN_ID_1;
248-
if (hw->phy.lan_id)
246+
if (hw->bus.lan_id)
249247
hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM;
250248
else
251249
hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM;

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3381,7 +3381,6 @@ struct ixgbe_phy_info {
33813381
bool sfp_setup_needed;
33823382
u32 revision;
33833383
enum ixgbe_media_type media_type;
3384-
u8 lan_id;
33853384
u32 phy_semaphore_mask;
33863385
bool reset_disable;
33873386
ixgbe_autoneg_advertised autoneg_advertised;

0 commit comments

Comments
 (0)