summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2017-02-15 10:46:41 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-15 13:20:55 -0500
commit688495b10ba703c1c13b3d05fcaecff55a320578 (patch)
tree6ee7f36661b77a20abb7b3d7abc88755d4472fbd /drivers/net
parentbd00632c5294bff0ed5826677cd2f1b2e303a6f6 (diff)
downloadlinux-stable-688495b10ba703c1c13b3d05fcaecff55a320578.tar.gz
linux-stable-688495b10ba703c1c13b3d05fcaecff55a320578.tar.bz2
linux-stable-688495b10ba703c1c13b3d05fcaecff55a320578.zip
net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed
In case of invalid speed given, stmmac_adjust_link() still record it as current speed. This patch modify the default case to set speed as SPEED_UNKNOWN if not 10/100/1000. 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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a87071d0ebfe..f7664b956eff 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -739,6 +739,7 @@ static void stmmac_adjust_link(struct net_device *dev)
default:
netif_warn(priv, link, priv->dev,
"broken speed: %d\n", phydev->speed);
+ phydev->speed = SPEED_UNKNOWN;
break;
}