mtd: mxc-nand: don't disable clock in mxcnd-suspend
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 11 Jan 2010 16:53:16 +0000 (17:53 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 25 Feb 2010 11:28:35 +0000 (11:28 +0000)
The clock must already be off after mtd->suspend.  Disabling it again
results in an negative overflow of the clock usage count.  This didn't
hurt as mxcnd_resume undid it after wake up.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/mxc_nand.c

index 84f363571c2453d520fab7efdb1dfbf733b9c373..970ce6bd06a878ef574944a079b974beca853d5f 100644 (file)
@@ -888,8 +888,12 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
        DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
 
        ret = mtd->suspend(mtd);
-       /* Disable the NFC clock */
-       clk_disable(host->clk);
+
+       /*
+        * nand_suspend locks the device for exclusive access, so
+        * the clock must already be off.
+        */
+       BUG_ON(!ret && host->clk_act);
 
        return ret;
 }
@@ -903,8 +907,6 @@ static int mxcnd_resume(struct platform_device *pdev)
 
        DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
 
-       /* Enable the NFC clock */
-       clk_enable(host->clk);
        mtd->resume(mtd);
 
        return ret;