ixgbe: Eliminate useless message and improve logic
authorMark Rustad <mark.d.rustad@intel.com>
Tue, 30 Aug 2016 18:33:43 +0000 (11:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Aug 2016 05:12:35 +0000 (22:12 -0700)
Remove a useless log message and improve the logic for setting
a PHY address from the contents of the MNG_IF_SEL register.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index fb1b819d83115e26dfc713c8d236bf75dc836191..e092a892941330ad348b133476f7ec4a01e5b6af 100644 (file)
@@ -2394,18 +2394,12 @@ static void ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw)
        /* If X552 (X550EM_a) and MDIO is connected to external PHY, then set
         * PHY address. This register field was has only been used for X552.
         */
-       if (!hw->phy.nw_mng_if_sel) {
-               if (hw->mac.type == ixgbe_mac_x550em_a) {
-                       struct ixgbe_adapter *adapter = hw->back;
-
-                       e_warn(drv, "nw_mng_if_sel not set\n");
-               }
-               return;
+       if (hw->mac.type == ixgbe_mac_x550em_a &&
+           hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) {
+               hw->phy.mdio.prtad = (hw->phy.nw_mng_if_sel &
+                                     IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD) >>
+                                    IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT;
        }
-
-       hw->phy.mdio.prtad = (hw->phy.nw_mng_if_sel &
-                             IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD) >>
-                            IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT;
 }
 
 /** ixgbe_init_phy_ops_X550em - PHY/SFP specific init