Print this page
3014 Intel X540 Support (fix lint)

@@ -54,11 +54,13 @@
         DEBUGFUNC("ixgbe_init_shared_code");
 
         /*
          * Set the mac type
          */
-        ixgbe_set_mac_type(hw);
+        status = ixgbe_set_mac_type(hw);
+        if (status != IXGBE_SUCCESS)
+                return (status);
 
         switch (hw->mac.type) {
         case ixgbe_mac_82598EB:
                 status = ixgbe_init_ops_82598(hw);
                 break;

@@ -446,15 +448,23 @@
  *  Reads a value from a specified PHY register
  **/
 s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
                        u16 *phy_data)
 {
+        s32 status;
+
         if (hw->phy.id == 0)
-                ixgbe_identify_phy(hw);
+                status = ixgbe_identify_phy(hw);
+        else
+                status = IXGBE_SUCCESS;
 
-        return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
-                               device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
+        if (status == IXGBE_SUCCESS) {
+                status = ixgbe_call_func(hw, hw->phy.ops.read_reg,
+                    (hw, reg_addr, device_type, phy_data),
+                    IXGBE_NOT_IMPLEMENTED);
+        }
+        return (status);
 }
 
 /**
  *  ixgbe_write_phy_reg - Write PHY register
  *  @hw: pointer to hardware structure

@@ -464,15 +474,24 @@
  *  Writes a value to specified PHY register
  **/
 s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
                         u16 phy_data)
 {
+        s32 status;
+
         if (hw->phy.id == 0)
-                ixgbe_identify_phy(hw);
+                status = ixgbe_identify_phy(hw);
+        else
+                status = IXGBE_SUCCESS;
 
-        return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
-                               device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
+        if (status == IXGBE_SUCCESS) {
+                status = ixgbe_call_func(hw, hw->phy.ops.write_reg,
+                    (hw, reg_addr, device_type, phy_data),
+                    IXGBE_NOT_IMPLEMENTED);
+        }
+
+        return status;
 }
 
 /**
  *  ixgbe_setup_phy_link - Restart PHY autoneg
  *  @hw: pointer to hardware structure