Skip to content

Commit b83c283

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
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>
1 parent 3b58247 commit b83c283

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/phy/phylink.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,14 +2295,12 @@ int phylink_fwnode_phy_connect(struct phylink *pl,
22952295
struct phy_device *phy_dev;
22962296
int ret;
22972297

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))
23022299
return 0;
23032300

23042301
phy_fwnode = fwnode_get_phy_node(fwnode);
23052302
if (IS_ERR(phy_fwnode)) {
2303+
/* PHY mode requires a PHY to be specified. */
23062304
if (pl->cfg_link_an_mode == MLO_AN_PHY)
23072305
return -ENODEV;
23082306
return 0;

0 commit comments

Comments
 (0)