diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2017-02-15 10:46:42 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-15 13:20:55 -0500 |
commit | 5db1355673205dccaf754dc3cb2f6b5abc2ff67e (patch) | |
tree | 166ab5eaee77a74861f155657518cd60652e1299 /drivers/net | |
parent | 688495b10ba703c1c13b3d05fcaecff55a320578 (diff) |
net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid
This patch mutualise a bit by running stmmac_hw_fix_mac_speed() after
the switch in case of valid speed.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f7664b956eff..bebe81010644 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -719,7 +719,6 @@ static void stmmac_adjust_link(struct net_device *dev) if (priv->plat->has_gmac || priv->plat->has_gmac4) ctrl &= ~priv->hw->link.port; - stmmac_hw_fix_mac_speed(priv); break; case 100: case 10: @@ -734,7 +733,6 @@ static void stmmac_adjust_link(struct net_device *dev) } else { ctrl &= ~priv->hw->link.port; } - stmmac_hw_fix_mac_speed(priv); break; default: netif_warn(priv, link, priv->dev, @@ -742,7 +740,8 @@ static void stmmac_adjust_link(struct net_device *dev) phydev->speed = SPEED_UNKNOWN; break; } - + if (phydev->speed != SPEED_UNKNOWN) + stmmac_hw_fix_mac_speed(priv); priv->speed = phydev->speed; } |