aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2017-02-15 04:46:43 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-15 13:20:55 -0500
commit9beae261baab3f5a3001933cbc4d321538bef344 (patch)
tree49d62faabe8d9a21a963d0ccadba049dc5ea41e2
parent5db1355673205dccaf754dc3cb2f6b5abc2ff67e (diff)
net: stmmac: split the stmmac_adjust_link 10/100 case
The 10/100 case have too many ifcase. This patch split it for removing an if. 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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index bebe81010644..3cbe09682afe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -721,15 +721,19 @@ static void stmmac_adjust_link(struct net_device *dev)
721 ctrl &= ~priv->hw->link.port; 721 ctrl &= ~priv->hw->link.port;
722 break; 722 break;
723 case 100: 723 case 100:
724 if (priv->plat->has_gmac ||
725 priv->plat->has_gmac4) {
726 ctrl |= priv->hw->link.port;
727 ctrl |= priv->hw->link.speed;
728 } else {
729 ctrl &= ~priv->hw->link.port;
730 }
731 break;
724 case 10: 732 case 10:
725 if (priv->plat->has_gmac || 733 if (priv->plat->has_gmac ||
726 priv->plat->has_gmac4) { 734 priv->plat->has_gmac4) {
727 ctrl |= priv->hw->link.port; 735 ctrl |= priv->hw->link.port;
728 if (phydev->speed == SPEED_100) { 736 ctrl &= ~(priv->hw->link.speed);
729 ctrl |= priv->hw->link.speed;
730 } else {
731 ctrl &= ~(priv->hw->link.speed);
732 }
733 } else { 737 } else {
734 ctrl &= ~priv->hw->link.port; 738 ctrl &= ~priv->hw->link.port;
735 } 739 }