Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: gianfar: simplify init_phy()

Use phy_set_max_speed() to simplify init_phy().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/b863dcf7-31e8-45a1-a284-7075da958ff0@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
6a0ca73e 44f79b23

+2 -12
+2 -12
drivers/net/ethernet/freescale/gianfar.c
··· 1647 1647 */ 1648 1648 static int init_phy(struct net_device *dev) 1649 1649 { 1650 - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; 1651 1650 struct gfar_private *priv = netdev_priv(dev); 1652 1651 phy_interface_t interface = priv->interface; 1653 1652 struct phy_device *phydev; 1654 1653 struct ethtool_keee edata; 1655 - 1656 - linkmode_set_bit_array(phy_10_100_features_array, 1657 - ARRAY_SIZE(phy_10_100_features_array), 1658 - mask); 1659 - linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, mask); 1660 - linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask); 1661 - if (priv->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT) 1662 - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, mask); 1663 1654 1664 1655 priv->oldlink = 0; 1665 1656 priv->oldspeed = 0; ··· 1666 1675 if (interface == PHY_INTERFACE_MODE_SGMII) 1667 1676 gfar_configure_serdes(dev); 1668 1677 1669 - /* Remove any features not supported by the controller */ 1670 - linkmode_and(phydev->supported, phydev->supported, mask); 1671 - linkmode_copy(phydev->advertising, phydev->supported); 1678 + if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT)) 1679 + phy_set_max_speed(phydev, SPEED_100); 1672 1680 1673 1681 /* Add support for flow control */ 1674 1682 phy_support_asym_pause(phydev);