aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2017-02-15 04:46:42 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-15 13:20:55 -0500
commit5db1355673205dccaf754dc3cb2f6b5abc2ff67e (patch)
tree166ab5eaee77a74861f155657518cd60652e1299
parent688495b10ba703c1c13b3d05fcaecff55a320578 (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>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c5
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)
719 if (priv->plat->has_gmac || 719 if (priv->plat->has_gmac ||
720 priv->plat->has_gmac4) 720 priv->plat->has_gmac4)
721 ctrl &= ~priv->hw->link.port; 721 ctrl &= ~priv->hw->link.port;
722 stmmac_hw_fix_mac_speed(priv);
723 break; 722 break;
724 case 100: 723 case 100:
725 case 10: 724 case 10:
@@ -734,7 +733,6 @@ static void stmmac_adjust_link(struct net_device *dev)
734 } else { 733 } else {
735 ctrl &= ~priv->hw->link.port; 734 ctrl &= ~priv->hw->link.port;
736 } 735 }
737 stmmac_hw_fix_mac_speed(priv);
738 break; 736 break;
739 default: 737 default:
740 netif_warn(priv, link, priv->dev, 738 netif_warn(priv, link, priv->dev,
@@ -742,7 +740,8 @@ static void stmmac_adjust_link(struct net_device *dev)
742 phydev->speed = SPEED_UNKNOWN; 740 phydev->speed = SPEED_UNKNOWN;
743 break; 741 break;
744 } 742 }
745 743 if (phydev->speed != SPEED_UNKNOWN)
744 stmmac_hw_fix_mac_speed(priv);
746 priv->speed = phydev->speed; 745 priv->speed = phydev->speed;
747 } 746 }
748 747