netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: gianfar: simplify init_phy()
@ 2025-02-06 22:06 Heiner Kallweit
  2025-02-06 23:06 ` Andrew Lunn
  2025-02-08  1:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2025-02-06 22:06 UTC (permalink / raw)
  To: Claudiu Manoil, Andrew Lunn, Paolo Abeni, David Miller,
	Jakub Kicinski, Eric Dumazet
  Cc: netdev@vger.kernel.org, Simon Horman

Use phy_set_max_speed() to simplify init_phy().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 435138f46..deb35b38c 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1647,20 +1647,11 @@ static void gfar_configure_serdes(struct net_device *dev)
  */
 static int init_phy(struct net_device *dev)
 {
-	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 	struct gfar_private *priv = netdev_priv(dev);
 	phy_interface_t interface = priv->interface;
 	struct phy_device *phydev;
 	struct ethtool_keee edata;
 
-	linkmode_set_bit_array(phy_10_100_features_array,
-			       ARRAY_SIZE(phy_10_100_features_array),
-			       mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, mask);
-	linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask);
-	if (priv->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT)
-		linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, mask);
-
 	priv->oldlink = 0;
 	priv->oldspeed = 0;
 	priv->oldduplex = -1;
@@ -1675,9 +1666,8 @@ static int init_phy(struct net_device *dev)
 	if (interface == PHY_INTERFACE_MODE_SGMII)
 		gfar_configure_serdes(dev);
 
-	/* Remove any features not supported by the controller */
-	linkmode_and(phydev->supported, phydev->supported, mask);
-	linkmode_copy(phydev->advertising, phydev->supported);
+	if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT))
+		phy_set_max_speed(phydev, SPEED_100);
 
 	/* Add support for flow control */
 	phy_support_asym_pause(phydev);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: gianfar: simplify init_phy()
  2025-02-06 22:06 [PATCH net-next] net: gianfar: simplify init_phy() Heiner Kallweit
@ 2025-02-06 23:06 ` Andrew Lunn
  2025-02-08  1:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-02-06 23:06 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Claudiu Manoil, Andrew Lunn, Paolo Abeni, David Miller,
	Jakub Kicinski, Eric Dumazet, netdev@vger.kernel.org,
	Simon Horman

On Thu, Feb 06, 2025 at 11:06:07PM +0100, Heiner Kallweit wrote:
> Use phy_set_max_speed() to simplify init_phy().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: gianfar: simplify init_phy()
  2025-02-06 22:06 [PATCH net-next] net: gianfar: simplify init_phy() Heiner Kallweit
  2025-02-06 23:06 ` Andrew Lunn
@ 2025-02-08  1:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-08  1:30 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: claudiu.manoil, andrew+netdev, pabeni, davem, kuba, edumazet,
	netdev, horms

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 6 Feb 2025 23:06:07 +0100 you wrote:
> Use phy_set_max_speed() to simplify init_phy().
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/ethernet/freescale/gianfar.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)

Here is the summary with links:
  - [net-next] net: gianfar: simplify init_phy()
    https://git.kernel.org/netdev/net-next/c/6a0ca73e5144

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-08  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-06 22:06 [PATCH net-next] net: gianfar: simplify init_phy() Heiner Kallweit
2025-02-06 23:06 ` Andrew Lunn
2025-02-08  1:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).