Commit 5db13556 authored by LABBE Corentin's avatar LABBE Corentin Committed by David S. Miller

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: 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 688495b1
......@@ -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;
}
......
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