Commit a18e6521 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller

net: phylink: handle NA interface mode in phylink_fwnode_phy_connect()

Commit 4904b6ea ("net: phy: phylink: Use PHY device interface if
N/A") introduced handling for the phy interface mode where this is not
known at phylink creation time. This was never added to the OF/fwnode
paths, but is necessary when the phy is present in DT, but the phy-mode
is not specified.

Add this handling.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 291dcae3
...@@ -1325,7 +1325,8 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, ...@@ -1325,7 +1325,8 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
mutex_unlock(&phy->lock); mutex_unlock(&phy->lock);
phylink_dbg(pl, phylink_dbg(pl,
"phy: setting supported %*pb advertising %*pb\n", "phy: %s setting supported %*pb advertising %*pb\n",
phy_modes(interface),
__ETHTOOL_LINK_MODE_MASK_NBITS, pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS, pl->supported,
__ETHTOOL_LINK_MODE_MASK_NBITS, phy->advertising); __ETHTOOL_LINK_MODE_MASK_NBITS, phy->advertising);
...@@ -1443,6 +1444,12 @@ int phylink_fwnode_phy_connect(struct phylink *pl, ...@@ -1443,6 +1444,12 @@ int phylink_fwnode_phy_connect(struct phylink *pl,
if (!phy_dev) if (!phy_dev)
return -ENODEV; return -ENODEV;
/* Use PHY device/driver interface */
if (pl->link_interface == PHY_INTERFACE_MODE_NA) {
pl->link_interface = phy_dev->interface;
pl->link_config.interface = pl->link_interface;
}
ret = phy_attach_direct(pl->netdev, phy_dev, flags, ret = phy_attach_direct(pl->netdev, phy_dev, flags,
pl->link_interface); pl->link_interface);
if (ret) { if (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