aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-09-08 00:41:53 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-08 00:41:53 -0400
commiteb84d6b60491a3ca3d90d62ee5346b007770d40d (patch)
tree22aadf9ada15e1ae5ba4c400aafab6f2541996e6 /drivers/net/phy/phy.c
parent97a13e5289baa96eaddd06e61d277457d837af3a (diff)
parentd030671f3f261e528dc6e396a13f10859a74ae7c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 932190e04d08..1dfffdc9dfc3 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1040,31 +1040,31 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
1040 /* First check if the EEE ability is supported */ 1040 /* First check if the EEE ability is supported */
1041 eee_cap = phy_read_mmd_indirect(phydev, MDIO_PCS_EEE_ABLE, 1041 eee_cap = phy_read_mmd_indirect(phydev, MDIO_PCS_EEE_ABLE,
1042 MDIO_MMD_PCS, phydev->addr); 1042 MDIO_MMD_PCS, phydev->addr);
1043 if (eee_cap < 0) 1043 if (eee_cap <= 0)
1044 return eee_cap; 1044 goto eee_exit_err;
1045 1045
1046 cap = mmd_eee_cap_to_ethtool_sup_t(eee_cap); 1046 cap = mmd_eee_cap_to_ethtool_sup_t(eee_cap);
1047 if (!cap) 1047 if (!cap)
1048 return -EPROTONOSUPPORT; 1048 goto eee_exit_err;
1049 1049
1050 /* Check which link settings negotiated and verify it in 1050 /* Check which link settings negotiated and verify it in
1051 * the EEE advertising registers. 1051 * the EEE advertising registers.
1052 */ 1052 */
1053 eee_lp = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_LPABLE, 1053 eee_lp = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_LPABLE,
1054 MDIO_MMD_AN, phydev->addr); 1054 MDIO_MMD_AN, phydev->addr);
1055 if (eee_lp < 0) 1055 if (eee_lp <= 0)
1056 return eee_lp; 1056 goto eee_exit_err;
1057 1057
1058 eee_adv = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_ADV, 1058 eee_adv = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_ADV,
1059 MDIO_MMD_AN, phydev->addr); 1059 MDIO_MMD_AN, phydev->addr);
1060 if (eee_adv < 0) 1060 if (eee_adv <= 0)
1061 return eee_adv; 1061 goto eee_exit_err;
1062 1062
1063 adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); 1063 adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv);
1064 lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); 1064 lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp);
1065 idx = phy_find_setting(phydev->speed, phydev->duplex); 1065 idx = phy_find_setting(phydev->speed, phydev->duplex);
1066 if (!(lp & adv & settings[idx].setting)) 1066 if (!(lp & adv & settings[idx].setting))
1067 return -EPROTONOSUPPORT; 1067 goto eee_exit_err;
1068 1068
1069 if (clk_stop_enable) { 1069 if (clk_stop_enable) {
1070 /* Configure the PHY to stop receiving xMII 1070 /* Configure the PHY to stop receiving xMII
@@ -1084,7 +1084,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
1084 1084
1085 return 0; /* EEE supported */ 1085 return 0; /* EEE supported */
1086 } 1086 }
1087 1087eee_exit_err:
1088 return -EPROTONOSUPPORT; 1088 return -EPROTONOSUPPORT;
1089} 1089}
1090EXPORT_SYMBOL(phy_init_eee); 1090EXPORT_SYMBOL(phy_init_eee);