[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1369662513-32133-4-git-send-email-fabio.estevam@freescale.com>
Date: Mon, 27 May 2013 10:48:31 -0300
From: Fabio Estevam <fabio.estevam@...escale.com>
To: <davem@...emloft.net>
CC: <shawn.guo@...aro.org>, <kernel@...gutronix.de>,
<netdev@...r.kernel.org>,
Fabio Estevam <fabio.estevam@...escale.com>
Subject: [PATCH 3/5] fec: Disable the PHY regulator on error and removal
In the case of error during probe, disable the PHY regulator.
Do the same in fec_drv_remove().
Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index dc7388e..58ac0c7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1926,6 +1926,8 @@ fec_probe(struct platform_device *pdev)
"Failed to enable phy regulator: %d\n", ret);
goto failed_regulator;
}
+ } else {
+ fep->reg_phy = NULL;
}
fec_reset_phy(pdev);
@@ -1982,6 +1984,8 @@ failed_irq:
free_irq(irq, ndev);
}
failed_init:
+ if (fep->reg_phy)
+ regulator_disable(fep->reg_phy);
failed_regulator:
clk_disable_unprepare(fep->clk_ahb);
clk_disable_unprepare(fep->clk_ipg);
@@ -2005,6 +2009,8 @@ fec_drv_remove(struct platform_device *pdev)
unregister_netdev(ndev);
fec_enet_mii_remove(fep);
del_timer_sync(&fep->time_keep);
+ if (fep->reg_phy)
+ regulator_disable(fep->reg_phy);
clk_disable_unprepare(fep->clk_ptp);
if (fep->ptp_clock)
ptp_clock_unregister(fep->ptp_clock);
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists