net: phylink: use phylink_expects_phy() in phylink_fwnode_phy_connect()
Subsystems (4)
PATCH 1/1 net: phylink: use phylink_expects_phy() in phylink_fwnode_phy_connect()
The tests in phylink_expects_phy() and phylink_fwnode_phy_connect() are identical (by intention). Use phylink_expects_phy() to decide whether to ignore a call to phylink_fwnode_phy_connect().
--- drivers/net/phy/phylink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/phy/phylink.c +2 -4
@@ -2295,14 +2295,12 @@ int phylink_fwnode_phy_connect(struct phylink *pl,struct phy_device *phy_dev;int ret; -/* Fixed links and 802.3z are handled without needing a PHY */ -if (pl->cfg_link_an_mode ==MLO_AN_FIXED || - (pl->cfg_link_an_mode ==MLO_AN_INBAND && -phy_interface_mode_is_8023z (pl->link_interface))) +if (!phylink_expects_phy (pl))return 0 ; phy_fwnode =fwnode_get_phy_node (fwnode);if (IS_ERR (phy_fwnode)) { +/* PHY mode requires a PHY to be specified. */ if (pl->cfg_link_an_mode ==MLO_AN_PHY )return -ENODEV ;return 0 ;
Signature · 1 line
2.47.3
Quoted 5 lines · Russell King (Oracle)
The tests in
phylink_expects_phy()andphylink_fwnode_phy_connect()are identical (by intention). Usephylink_expects_phy()to decide whether to ignore a call tophylink_fwnode_phy_connect().Signed-off-by Russell King (Oracle) <[email protected]>
Maxime
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 24 Mar 2026 10:46:52 +0000 you wrote:
The tests in
phylink_expects_phy()andphylink_fwnode_phy_connect()are identical (by intention). Usephylink_expects_phy()to decide whether to ignore a call tophylink_fwnode_phy_connect().Signed-off-by Russell King (Oracle) <[email protected]>--- drivers/net/phy/phylink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Here is the summary with links:
- [net-next] net: phylink: use phylink_expects_phy() in phylink_fwnode_phy_connect()
https://git.kernel.org/netdev/net-next/c/b83c28328fee
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html