Skip to contentSkip to conversation

drivers: net: xgene-v2: Fix error return code in xge_mdio_config()

PATCH Applied Wei Yongjun 2 participants 2 messages Apr 25, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: net: xgene-v2: Fix error return code in xge_mdio_config()

From: Wei Yongjun <[email protected]>

Fix to return error code -ENODEV from the no PHY found error handling case instead of 0, as done elsewhere in this function.

---
 drivers/net/ethernet/apm/xgene-v2/mdio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/apm/xgene-v2/mdio.c +1 -0
index a583c6a..f5fe3bb 100644
@@ -135,6 +135,7 @@ int xge_mdio_config(struct net_device *ndev)
 	phydev = phy_find_first(mdio_bus);
 	if (!phydev) {
 		dev_err(dev, "no PHY found\n");
+		ret = -ENODEV;
 		goto err;
 	}
 	phydev = phy_connect(ndev, phydev_name(phydev),