diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-09-12 01:53:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-13 05:24:20 +0200 |
commit | 58056c1e1b0e4951f3486bd552d8278194f8b84b (patch) | |
tree | a3aa813a842b5ad17c0639d92f0e1eede4161799 /drivers/net/ethernet/samsung | |
parent | net: phy: bcm63xx: Allow to be built with COMPILE_TEST (diff) | |
download | linux-58056c1e1b0e4951f3486bd552d8278194f8b84b.tar.xz linux-58056c1e1b0e4951f3486bd552d8278194f8b84b.zip |
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/samsung')
-rw-r--r-- | drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index a9da1ad4b4f2..690aee88f0eb 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c @@ -298,8 +298,8 @@ static int sxgbe_init_phy(struct net_device *ndev) /* Stop Advertising 1000BASE Capability if interface is not GMII */ if ((phy_iface == PHY_INTERFACE_MODE_MII) || (phy_iface == PHY_INTERFACE_MODE_RMII)) - phydev->advertising &= ~(SUPPORTED_1000baseT_Half | - SUPPORTED_1000baseT_Full); + phy_set_max_speed(phydev, SPEED_1000); + if (phydev->phy_id == 0) { phy_disconnect(phydev); return -ENODEV; |