summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence
diff options
context:
space:
mode:
authorBoris BREZILLON <b.brezillon@overkiz.com>2013-08-27 14:36:14 +0200
committerDavid S. Miller <davem@davemloft.net>2013-08-29 15:21:45 -0400
commit7daa78e352fec0f638e1e665365779678845fd66 (patch)
treecb11d42d763faf52ca47f20fb58fb5d5db148fc8 /drivers/net/ethernet/cadence
parentfd094808a06e290432fc13c09aae808aea34d2ca (diff)
downloadtalos-obmc-linux-7daa78e352fec0f638e1e665365779678845fd66.tar.gz
talos-obmc-linux-7daa78e352fec0f638e1e665365779678845fd66.zip
net/cadence/macb: fix invalid 0 return if no phy is discovered on mii init
Replace misleading -1 (-EPERM) by a more appropriate return code (-ENXIO) in macb_mii_probe function. Save macb_mii_probe return before branching to err_out_unregister to avoid erronous 0 return. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cadence')
-rw-r--r--drivers/net/ethernet/cadence/macb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index fe06ab0f7375..7660c45a2eb9 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -276,7 +276,7 @@ static int macb_mii_probe(struct net_device *dev)
phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
netdev_err(dev, "no PHY found\n");
- return -1;
+ return -ENXIO;
}
pdata = dev_get_platdata(&bp->pdev->dev);
@@ -379,9 +379,9 @@ int macb_mii_init(struct macb *bp)
if (err)
goto err_out_free_mdio_irq;
- if (macb_mii_probe(bp->dev) != 0) {
+ err = macb_mii_probe(bp->dev);
+ if (err)
goto err_out_unregister_bus;
- }
return 0;
OpenPOWER on IntegriCloud