spelling fixes
[dpdk.git] / lib / librte_pmd_e1000 / e1000 / e1000_82571.c
index 4aa33c4..5ff6c84 100644 (file)
@@ -395,7 +395,7 @@ STATIC s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
        }
 
        /* Ensure that the inter-port SWSM.SMBI lock bit is clear before
-        * first NVM or PHY acess. This should be done for single-port
+        * first NVM or PHY access. This should be done for single-port
         * devices, and for one port only on dual-port devices so that
         * for those devices we can still use the SMBI lock to synchronize
         * inter-port accesses to the PHY & NVM.
@@ -1007,6 +1007,8 @@ STATIC s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
                /* When LPLU is enabled, we should disable SmartSpeed */
                ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
                                            &data);
+               if (ret_val)
+                       return ret_val;
                data &= ~IGP01E1000_PSCFR_SMART_SPEED;
                ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
                                             data);
@@ -1098,8 +1100,6 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
        default:
                break;
        }
-       if (ret_val)
-               DEBUGOUT("Cannot acquire MDIO ownership\n");
 
        ctrl = E1000_READ_REG(hw, E1000_CTRL);
 
@@ -1108,9 +1108,16 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 
        /* Must release MDIO ownership and mutex after MAC reset. */
        switch (hw->mac.type) {
+       case e1000_82573:
+               /* Release mutex only if the hw semaphore is acquired */
+               if (!ret_val)
+                       e1000_put_hw_semaphore_82573(hw);
+               break;
        case e1000_82574:
        case e1000_82583:
-               e1000_put_hw_semaphore_82574(hw);
+               /* Release mutex only if the hw semaphore is acquired */
+               if (!ret_val)
+                       e1000_put_hw_semaphore_82574(hw);
                break;
        default:
                break;
@@ -1916,6 +1923,8 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
                        if (ret_val)
                                return ret_val;
                        ret_val = nvm->ops.update(hw);
+                       if (ret_val)
+                               return ret_val;
                }
        }