Skip to content

Commit 5078984

Browse files
tlendackydavem330
authored andcommitted
amd-xgbe: Remove the XGBE_LINK state bit
The XGBE_LINK bit is used just to determine whether to call the netif_carrier_on/off functions. Rather than define and use this bit, just call the functions. The netif_carrier_ok function can be used in place of checking the XGBE_LINK bit in the future. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent afb43e8 commit 5078984

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
11151115
unsigned int reg, link_aneg;
11161116

11171117
if (test_bit(XGBE_LINK_ERR, &pdata->dev_state)) {
1118-
if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
1119-
netif_carrier_off(pdata->netdev);
1118+
netif_carrier_off(pdata->netdev);
11201119

11211120
pdata->phy.link = 0;
11221121
goto adjust_link;
@@ -1142,10 +1141,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
11421141
if (test_bit(XGBE_LINK_INIT, &pdata->dev_state))
11431142
clear_bit(XGBE_LINK_INIT, &pdata->dev_state);
11441143

1145-
if (!test_bit(XGBE_LINK, &pdata->dev_state)) {
1146-
set_bit(XGBE_LINK, &pdata->dev_state);
1147-
netif_carrier_on(pdata->netdev);
1148-
}
1144+
netif_carrier_on(pdata->netdev);
11491145
} else {
11501146
if (test_bit(XGBE_LINK_INIT, &pdata->dev_state)) {
11511147
xgbe_check_link_timeout(pdata);
@@ -1156,10 +1152,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
11561152

11571153
xgbe_phy_status_aneg(pdata);
11581154

1159-
if (test_bit(XGBE_LINK, &pdata->dev_state)) {
1160-
clear_bit(XGBE_LINK, &pdata->dev_state);
1161-
netif_carrier_off(pdata->netdev);
1162-
}
1155+
netif_carrier_off(pdata->netdev);
11631156
}
11641157

11651158
adjust_link:
@@ -1179,8 +1172,7 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
11791172
devm_free_irq(pdata->dev, pdata->an_irq, pdata);
11801173

11811174
pdata->phy.link = 0;
1182-
if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
1183-
netif_carrier_off(pdata->netdev);
1175+
netif_carrier_off(pdata->netdev);
11841176

11851177
xgbe_phy_adjust_link(pdata);
11861178
}

drivers/net/ethernet/amd/xgbe/xgbe.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ struct xgbe_channel {
459459

460460
enum xgbe_state {
461461
XGBE_DOWN,
462-
XGBE_LINK,
463462
XGBE_LINK_INIT,
464463
XGBE_LINK_ERR,
465464
};

0 commit comments

Comments
 (0)