summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mediatek/mtk_eth_soc.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-09-12 01:53:11 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-12 20:24:20 -0700
commit58056c1e1b0e4951f3486bd552d8278194f8b84b (patch)
treea3aa813a842b5ad17c0639d92f0e1eede4161799 /drivers/net/ethernet/mediatek/mtk_eth_soc.c
parent15d8daf7bc2d1415f14f3cc3378226fc7d836156 (diff)
downloadlinux-58056c1e1b0e4951f3486bd552d8278194f8b84b.tar.bz2
net: ethernet: Use phy_set_max_speed() to limit advertised speed
Many Ethernet MAC drivers want to limit the PHY to only advertise a maximum speed of 100Mbs or 1Gbps. Rather than using a mask, make use of the helper function phy_set_max_speed(). Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mediatek/mtk_eth_soc.c')
-rw-r--r--drivers/net/ethernet/mediatek/mtk_eth_soc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index b44bcfd85b05..e93b5375504b 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -359,8 +359,8 @@ static int mtk_phy_connect(struct net_device *dev)
dev->phydev->supported |=
SUPPORTED_Pause | SUPPORTED_Asym_Pause;
- dev->phydev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause |
- SUPPORTED_Asym_Pause;
+ phy_set_max_speed(dev->phydev, SPEED_1000);
+ dev->phydev->supported &= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
dev->phydev->advertising = dev->phydev->supported |
ADVERTISED_Autoneg;
phy_start_aneg(dev->phydev);