net: ethernet: mediatek: fix error handling inside mtk_mdio_init
authorSean Wang <sean.wang@mediatek.com>
Thu, 1 Sep 2016 02:47:35 +0000 (10:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Sep 2016 03:53:48 +0000 (20:53 -0700)
Return -ENODEV if the MDIO bus is disabled in the device tree.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: John Crispin <john@phrozen.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index 0367f510f81a47719b6695a1f56cf202eb99a22e..d9199151a83e9bbe6e380bea2e724fa341dab100 100644 (file)
@@ -304,7 +304,7 @@ static int mtk_mdio_init(struct mtk_eth *eth)
        }
 
        if (!of_device_is_available(mii_np)) {
-               ret = 0;
+               ret = -ENODEV;
                goto err_put_node;
        }