[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1354779748-28869-1-git-send-email-LW@KARO-electronics.de>
Date: Thu, 6 Dec 2012 08:42:27 +0100
From: Lothar Waßmann <LW@...O-electronics.de>
To: linux-mtd@...ts.infradead.org
Cc: Shawn Guo <shawn.guo@...aro.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
linux-kernel@...r.kernel.org,
David Woodhouse <dwmw2@...radead.org>,
Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>,
Lothar Waßmann <LW@...O-electronics.de>
Subject: [PATCH 1/2] mtd: mxc_nand: fix unbalanced clk_disable() in error path
If nand_scan_ident() or nand_scan_tail() fails, the NAND chip may have
been deselected and the clock already disabled. Thus, check 'clk_act'
in the error path to decide whether the clock still needs to be
disabled.
This fixes a:
|WARNING: at drivers/clk/clk.c:472 __clk_disable+0x3c/0x78()
Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
---
drivers/mtd/nand/mxc_nand.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index d316324..d965809 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1556,7 +1556,8 @@ static int mxcnd_probe(struct platform_device *pdev)
return 0;
escan:
- clk_disable_unprepare(host->clk);
+ if (host->clk_act)
+ clk_disable_unprepare(host->clk);
return err;
}
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists