From 84b1678518ccafdb53b7ccf86e3d05a739718cd5 Mon Sep 17 00:00:00 2001 From: "Russell King (Oracle)" Date: Thu, 8 Feb 2024 12:44:26 +0000 Subject: net: phylink: move phylink_phy_no_inband() Since the BCM84881 driver always provides phy->supported_interfaces, and the driver is required for this PHY, move phylink_phy_no_inband() to the case where this is non-empty. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index b885a33c9152..c1a31f0cea61 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3580,9 +3580,6 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy) */ phy_support_asym_pause(phy); - if (phylink_phy_no_inband(phy)) - pl->sfp_link_an_mode = MLO_AN_PHY; - /* Set the PHY's host supported interfaces */ phy_interface_and(phy->host_interfaces, phylink_sfp_interfaces, pl->config->supported_interfaces); @@ -3613,6 +3610,9 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy) phylink_dbg(pl, "copper SFP: chosen %s interface\n", phy_modes(interface)); + if (phylink_phy_no_inband(phy)) + pl->sfp_link_an_mode = MLO_AN_PHY; + if (pl->cur_link_an_mode != pl->sfp_link_an_mode || pl->link_config.interface != interface) { pl->link_config.interface = interface; -- cgit