From 2131fba53186c22254ab762655675d3179adfb0f Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 10 Jun 2019 12:31:49 -0700 Subject: net: dsa: Deal with non-existing PHY/fixed-link 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: 0e27921816ad ("net: dsa: Use PHYLINK for the CPU/DSA ports") Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- net/dsa/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index 70744fec9717..585b6b9a9433 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -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; } -- cgit v1.2.3