Commit 7daa78e3 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by David S. Miller

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: default avatarBoris BREZILLON <b.brezillon@overkiz.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd094808
...@@ -276,7 +276,7 @@ static int macb_mii_probe(struct net_device *dev) ...@@ -276,7 +276,7 @@ static int macb_mii_probe(struct net_device *dev)
phydev = phy_find_first(bp->mii_bus); phydev = phy_find_first(bp->mii_bus);
if (!phydev) { if (!phydev) {
netdev_err(dev, "no PHY found\n"); netdev_err(dev, "no PHY found\n");
return -1; return -ENXIO;
} }
pdata = dev_get_platdata(&bp->pdev->dev); pdata = dev_get_platdata(&bp->pdev->dev);
...@@ -379,9 +379,9 @@ int macb_mii_init(struct macb *bp) ...@@ -379,9 +379,9 @@ int macb_mii_init(struct macb *bp)
if (err) if (err)
goto err_out_free_mdio_irq; 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; goto err_out_unregister_bus;
}
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment