Skip to content

Commit

Permalink
net: dsa: Deal with non-existing PHY/fixed-link
Browse files Browse the repository at this point in the history
We need to specifically deal with phylink_of_phy_connect() returning
-ENODEV, because this can happen when a CPU/DSA port does connect
neither to a PHY, nor has a fixed-link property. This is a valid use
case that is permitted by the binding and indicates to the switch:
auto-configure port with maximum capabilities.

Fixes: 0e27921 ("net: dsa: Use PHYLINK for the CPU/DSA ports")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Jun 12, 2019
1 parent fcf1536 commit 2131fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dsa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static int dsa_port_phylink_register(struct dsa_port *dp)
}

err = phylink_of_phy_connect(dp->pl, port_dn, 0);
if (err) {
if (err && err != -ENODEV) {
pr_err("could not attach to PHY: %d\n", err);
goto err_phy_connect;
}
Expand Down

0 comments on commit 2131fba

Please sign in to comment.