net: fec: free resource after phy probe failed
authorNimrod Andy <B38611@freescale.com>
Tue, 23 Sep 2014 07:40:58 +0000 (15:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Sep 2014 20:05:21 +0000 (16:05 -0400)
Free memory and disable all related clocks when there has no phy
connection or phy probe failed.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 3d12a841ad1500cdafb1ac5571a96c6108fcd8f3..2c7343473e1c3938d3ff2245b730a7ba1fdfce4c 100644 (file)
@@ -2675,6 +2675,8 @@ fec_enet_open(struct net_device *ndev)
        ret = fec_enet_mii_probe(ndev);
        if (ret) {
                fec_enet_free_buffers(ndev);
+               fec_enet_clk_enable(ndev, false);
+               pinctrl_pm_select_sleep_state(&fep->pdev->dev);
                return ret;
        }