summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-12-12 16:00:26 -0800
committerDavid S. Miller <davem@davemloft.net>2017-12-13 15:55:01 -0500
commit4904b6ea1f9dbf47107f50b1c502a22d0160712d (patch)
tree77f12c9c09f2fc812092bd735b7cb668b66a3372
parent0a62964c9020208c08c8b0323db9ea0c5980876f (diff)
downloadlinux-4904b6ea1f9dbf47107f50b1c502a22d0160712d.tar.bz2
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>
-rw-r--r--drivers/net/phy/phylink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 94b43c5237fa..60c1b7e5490e 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -715,6 +715,12 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy)
phy_interface_mode_is_8023z(pl->link_interface))))
return -EINVAL;
+ /* Use PHY device/driver interface */
+ if (pl->link_interface == PHY_INTERFACE_MODE_NA) {
+ pl->link_interface = phy->interface;
+ pl->link_config.interface = pl->link_interface;
+ }
+
ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_interface);
if (ret)
return ret;