Skip to content

Commit 4904b6e

Browse files
ffainellidavem330
authored andcommitted
net: phy: phylink: Use PHY device interface if N/A
We may not always be able to resolve a correct phy_interface_t value before actually connecting to the PHY device, when that happens, just have phylink_connect_phy() utilize what the PHY device/driver provided. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0a62964 commit 4904b6e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/phy/phylink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,12 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy)
715715
phy_interface_mode_is_8023z(pl->link_interface))))
716716
return -EINVAL;
717717

718+
/* Use PHY device/driver interface */
719+
if (pl->link_interface == PHY_INTERFACE_MODE_NA) {
720+
pl->link_interface = phy->interface;
721+
pl->link_config.interface = pl->link_interface;
722+
}
723+
718724
ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_interface);
719725
if (ret)
720726
return ret;

0 commit comments

Comments
 (0)