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: 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().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1w4zHg-0000000DmC4-2oyb@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
b83c2832 3b582479

+2 -4
+2 -4
drivers/net/phy/phylink.c
··· 2295 2295 struct phy_device *phy_dev; 2296 2296 int ret; 2297 2297 2298 - /* Fixed links and 802.3z are handled without needing a PHY */ 2299 - if (pl->cfg_link_an_mode == MLO_AN_FIXED || 2300 - (pl->cfg_link_an_mode == MLO_AN_INBAND && 2301 - phy_interface_mode_is_8023z(pl->link_interface))) 2298 + if (!phylink_expects_phy(pl)) 2302 2299 return 0; 2303 2300 2304 2301 phy_fwnode = fwnode_get_phy_node(fwnode); 2305 2302 if (IS_ERR(phy_fwnode)) { 2303 + /* PHY mode requires a PHY to be specified. */ 2306 2304 if (pl->cfg_link_an_mode == MLO_AN_PHY) 2307 2305 return -ENODEV; 2308 2306 return 0;