amd-xgbe: Remove the XGBE_LINK state bit
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Wed, 30 Sep 2015 13:53:22 +0000 (08:53 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Oct 2015 10:23:27 +0000 (03:23 -0700)
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 <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
drivers/net/ethernet/amd/xgbe/xgbe.h

index 9088c3a35a207ec6a60e1b1eb10e112f1e2f2e90..4460580818665d80e04ad6e53039d7d7e7f5fc99 100644 (file)
@@ -1115,8 +1115,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
        unsigned int reg, link_aneg;
 
        if (test_bit(XGBE_LINK_ERR, &pdata->dev_state)) {
-               if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
-                       netif_carrier_off(pdata->netdev);
+               netif_carrier_off(pdata->netdev);
 
                pdata->phy.link = 0;
                goto adjust_link;
@@ -1142,10 +1141,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
                if (test_bit(XGBE_LINK_INIT, &pdata->dev_state))
                        clear_bit(XGBE_LINK_INIT, &pdata->dev_state);
 
-               if (!test_bit(XGBE_LINK, &pdata->dev_state)) {
-                       set_bit(XGBE_LINK, &pdata->dev_state);
-                       netif_carrier_on(pdata->netdev);
-               }
+               netif_carrier_on(pdata->netdev);
        } else {
                if (test_bit(XGBE_LINK_INIT, &pdata->dev_state)) {
                        xgbe_check_link_timeout(pdata);
@@ -1156,10 +1152,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
 
                xgbe_phy_status_aneg(pdata);
 
-               if (test_bit(XGBE_LINK, &pdata->dev_state)) {
-                       clear_bit(XGBE_LINK, &pdata->dev_state);
-                       netif_carrier_off(pdata->netdev);
-               }
+               netif_carrier_off(pdata->netdev);
        }
 
 adjust_link:
@@ -1179,8 +1172,7 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
        devm_free_irq(pdata->dev, pdata->an_irq, pdata);
 
        pdata->phy.link = 0;
-       if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
-               netif_carrier_off(pdata->netdev);
+       netif_carrier_off(pdata->netdev);
 
        xgbe_phy_adjust_link(pdata);
 }
index a5f5a7869609d00100e4a47b194b34b5a46a2052..e234b9970318a37ec1e5f3048fe86c8aa4dcf919 100644 (file)
@@ -459,7 +459,6 @@ struct xgbe_channel {
 
 enum xgbe_state {
        XGBE_DOWN,
-       XGBE_LINK,
        XGBE_LINK_INIT,
        XGBE_LINK_ERR,
 };