Patchwork [09/15] nand: mxc_nand: Use clk_prepare_enable/clk_disable_unprepare

login
register
mail settings
Submitter Fabio Estevam
Date May 25, 2012, 11:14 p.m.
Message ID <1337987696-31728-9-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/161437/
State New
Headers show

Comments

Fabio Estevam - May 25, 2012, 11:14 p.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

Prepare the clock before enabling it.

Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: <linux-mtd@lists.infradead.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/nand/mxc_nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - May 27, 2012, 12:36 p.m.
On Fri, 2012-05-25 at 20:14 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Prepare the clock before enabling it.

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index fd14966..d6efa17 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -764,7 +764,7 @@  static void mxc_nand_select_chip_v2(struct mtd_info *mtd, int chip)
 	if (chip == -1) {
 		/* Disable the NFC clock */
 		if (host->clk_act) {
-			clk_disable(host->clk);
+			clk_disable_unprepare(host->clk);
 			host->clk_act = 0;
 		}
 		return;
@@ -772,7 +772,7 @@  static void mxc_nand_select_chip_v2(struct mtd_info *mtd, int chip)
 
 	if (!host->clk_act) {
 		/* Enable the NFC clock */
-		clk_enable(host->clk);
+		clk_prepare_enable(host->clk);
 		host->clk_act = 1;
 	}