]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: mxc_nand: fix unbalanced clk_disable() in error path
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 6 Dec 2012 07:42:27 +0000 (08:42 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 10 Dec 2012 14:45:04 +0000 (16:45 +0200)
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@KARO-electronics.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/nand/mxc_nand.c

index 4aef6a355d54088f10b67be200dcdfa696f5706a..ab0fe383c50b75cacc8e1e0e4bc9c17eda17ec6a 100644 (file)
@@ -1533,7 +1533,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;
 }