Skip to content

Commit

Permalink
mtd: mxc_nand: fix unbalanced clk_disable() in error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lothar Waßmann authored and Artem Bityutskiy committed Dec 10, 2012
1 parent 5346c27 commit c10d8ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/nand/mxc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c10d8ee

Please sign in to comment.