Commit 4904b6ea authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a62964c
...@@ -715,6 +715,12 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy) ...@@ -715,6 +715,12 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy)
phy_interface_mode_is_8023z(pl->link_interface)))) phy_interface_mode_is_8023z(pl->link_interface))))
return -EINVAL; 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); ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_interface);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment