Commit 9beae261 authored by LABBE Corentin's avatar LABBE Corentin Committed by David S. Miller

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: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5db13556
...@@ -721,15 +721,19 @@ static void stmmac_adjust_link(struct net_device *dev) ...@@ -721,15 +721,19 @@ static void stmmac_adjust_link(struct net_device *dev)
ctrl &= ~priv->hw->link.port; ctrl &= ~priv->hw->link.port;
break; break;
case 100: case 100:
case 10:
if (priv->plat->has_gmac || if (priv->plat->has_gmac ||
priv->plat->has_gmac4) { priv->plat->has_gmac4) {
ctrl |= priv->hw->link.port; ctrl |= priv->hw->link.port;
if (phydev->speed == SPEED_100) {
ctrl |= priv->hw->link.speed; ctrl |= priv->hw->link.speed;
} else { } else {
ctrl &= ~(priv->hw->link.speed); ctrl &= ~priv->hw->link.port;
} }
break;
case 10:
if (priv->plat->has_gmac ||
priv->plat->has_gmac4) {
ctrl |= priv->hw->link.port;
ctrl &= ~(priv->hw->link.speed);
} else { } else {
ctrl &= ~priv->hw->link.port; ctrl &= ~priv->hw->link.port;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment