Message ID | 20210914134331.2303380-1-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers | show |
Series | [v2,net] net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup | expand |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Tue, 14 Sep 2021 16:43:31 +0300 you wrote: > DSA supports connecting to a phy-handle, and has a fallback to a non-OF > based method of connecting to an internal PHY on the switch's own MDIO > bus, if no phy-handle and no fixed-link nodes were present. > > The -ENODEV error code from the first attempt (phylink_of_phy_connect) > is what triggers the second attempt (phylink_connect_phy). > > [...] Here is the summary with links: - [v2,net] net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup https://git.kernel.org/netdev/net/c/6a52e7336803 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 662ff531d4e2..a2bf2d8ac65b 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1854,13 +1854,11 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) * use the switch internal MDIO bus instead */ ret = dsa_slave_phy_connect(slave_dev, dp->index, phy_flags); - if (ret) { - netdev_err(slave_dev, - "failed to connect to port %d: %d\n", - dp->index, ret); - phylink_destroy(dp->pl); - return ret; - } + } + if (ret) { + netdev_err(slave_dev, "failed to connect to PHY: %pe\n", + ERR_PTR(ret)); + phylink_destroy(dp->pl); } return ret;