diff options
-rw-r--r-- | drivers/net/phy/phy.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c94e2a27446a..a854d38c231d 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -1036,31 +1036,31 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) | |||
1036 | /* First check if the EEE ability is supported */ | 1036 | /* First check if the EEE ability is supported */ |
1037 | eee_cap = phy_read_mmd_indirect(phydev, MDIO_PCS_EEE_ABLE, | 1037 | eee_cap = phy_read_mmd_indirect(phydev, MDIO_PCS_EEE_ABLE, |
1038 | MDIO_MMD_PCS, phydev->addr); | 1038 | MDIO_MMD_PCS, phydev->addr); |
1039 | if (eee_cap < 0) | 1039 | if (eee_cap <= 0) |
1040 | return eee_cap; | 1040 | goto eee_exit_err; |
1041 | 1041 | ||
1042 | cap = mmd_eee_cap_to_ethtool_sup_t(eee_cap); | 1042 | cap = mmd_eee_cap_to_ethtool_sup_t(eee_cap); |
1043 | if (!cap) | 1043 | if (!cap) |
1044 | return -EPROTONOSUPPORT; | 1044 | goto eee_exit_err; |
1045 | 1045 | ||
1046 | /* Check which link settings negotiated and verify it in | 1046 | /* Check which link settings negotiated and verify it in |
1047 | * the EEE advertising registers. | 1047 | * the EEE advertising registers. |
1048 | */ | 1048 | */ |
1049 | eee_lp = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_LPABLE, | 1049 | eee_lp = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_LPABLE, |
1050 | MDIO_MMD_AN, phydev->addr); | 1050 | MDIO_MMD_AN, phydev->addr); |
1051 | if (eee_lp < 0) | 1051 | if (eee_lp <= 0) |
1052 | return eee_lp; | 1052 | goto eee_exit_err; |
1053 | 1053 | ||
1054 | eee_adv = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_ADV, | 1054 | eee_adv = phy_read_mmd_indirect(phydev, MDIO_AN_EEE_ADV, |
1055 | MDIO_MMD_AN, phydev->addr); | 1055 | MDIO_MMD_AN, phydev->addr); |
1056 | if (eee_adv < 0) | 1056 | if (eee_adv <= 0) |
1057 | return eee_adv; | 1057 | goto eee_exit_err; |
1058 | 1058 | ||
1059 | adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); | 1059 | adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); |
1060 | lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); | 1060 | lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); |
1061 | idx = phy_find_setting(phydev->speed, phydev->duplex); | 1061 | idx = phy_find_setting(phydev->speed, phydev->duplex); |
1062 | if (!(lp & adv & settings[idx].setting)) | 1062 | if (!(lp & adv & settings[idx].setting)) |
1063 | return -EPROTONOSUPPORT; | 1063 | goto eee_exit_err; |
1064 | 1064 | ||
1065 | if (clk_stop_enable) { | 1065 | if (clk_stop_enable) { |
1066 | /* Configure the PHY to stop receiving xMII | 1066 | /* Configure the PHY to stop receiving xMII |
@@ -1080,7 +1080,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) | |||
1080 | 1080 | ||
1081 | return 0; /* EEE supported */ | 1081 | return 0; /* EEE supported */ |
1082 | } | 1082 | } |
1083 | 1083 | eee_exit_err: | |
1084 | return -EPROTONOSUPPORT; | 1084 | return -EPROTONOSUPPORT; |
1085 | } | 1085 | } |
1086 | EXPORT_SYMBOL(phy_init_eee); | 1086 | EXPORT_SYMBOL(phy_init_eee); |