drivers: net: xgene-v2: Fix error return code in xge_mdio_config()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 11:36:50 +0000 (11:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Apr 2017 17:48:06 +0000 (13:48 -0400)
Fix to return error code -ENODEV from the no PHY found error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene-v2/mdio.c

index a583c6a9a5eae7b68a78de9456034be714d97aa7..f5fe3bb2e59d9a9eecfcfb358af0a15785d69cfa 100644 (file)
@@ -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),