forked from Minki/linux
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>
This commit is contained in:
parent
5db1355673
commit
9beae261ba
@ -721,15 +721,19 @@ static void stmmac_adjust_link(struct net_device *dev)
|
||||
ctrl &= ~priv->hw->link.port;
|
||||
break;
|
||||
case 100:
|
||||
if (priv->plat->has_gmac ||
|
||||
priv->plat->has_gmac4) {
|
||||
ctrl |= priv->hw->link.port;
|
||||
ctrl |= priv->hw->link.speed;
|
||||
} else {
|
||||
ctrl &= ~priv->hw->link.port;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (priv->plat->has_gmac ||
|
||||
priv->plat->has_gmac4) {
|
||||
ctrl |= priv->hw->link.port;
|
||||
if (phydev->speed == SPEED_100) {
|
||||
ctrl |= priv->hw->link.speed;
|
||||
} else {
|
||||
ctrl &= ~(priv->hw->link.speed);
|
||||
}
|
||||
ctrl &= ~(priv->hw->link.speed);
|
||||
} else {
|
||||
ctrl &= ~priv->hw->link.port;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user