Imported Upstream version 16.11
[deb_dpdk.git] / lib / librte_eal / linuxapp / kni / ethtool / igb / e1000_phy.c
index df22470..d8a77c4 100644 (file)
@@ -17,7 +17,7 @@
   51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 
   The full GNU General Public License is included in this distribution in
-  the file called "COPYING".
+  the file called "LICENSE.GPL".
 
   Contact Information:
   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
@@ -3300,12 +3300,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data)
        *data = E1000_READ_REG(hw, E1000_MPHY_DATA);
 
        /* Disable access to mPHY if it was originally disabled */
-       if (locked)
+       if (locked) {
                ready = e1000_is_mphy_ready(hw);
                if (!ready)
                        return -E1000_ERR_PHY;
                E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
                                E1000_MPHY_DIS_ACCESS);
+       }
 
        return E1000_SUCCESS;
 }
@@ -3365,12 +3366,13 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,
        E1000_WRITE_REG(hw, E1000_MPHY_DATA, data);
 
        /* Disable access to mPHY if it was originally disabled */
-       if (locked)
+       if (locked) {
                ready = e1000_is_mphy_ready(hw);
                if (!ready)
                        return -E1000_ERR_PHY;
                E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
                                E1000_MPHY_DIS_ACCESS);
+       }
 
        return E1000_SUCCESS;
 }