]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers: sh: resume enabled clocks fix
authorMagnus Damm <damm@opensource.se>
Mon, 13 Jun 2011 04:42:15 +0000 (04:42 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 14 Jun 2011 06:15:25 +0000 (15:15 +0900)
Extend the SH / SH-Mobile ARM clock framework to only
resume clocks that have been enabled.

Without this fix divide-by-zero is triggering on sh7372
FSIDIV during system wide resume of Suspend-to-RAM.

Signed-off-by: Magnus Damm <damm@opensource.se>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/sh/clk/core.c

index 4f64183b27fa6283c80d4fa2d37aa61c61c127fe..7e9c39951ecb87c086c9ab439df893a5c0980752 100644 (file)
@@ -635,7 +635,7 @@ static void clks_core_resume(void)
        struct clk *clkp;
 
        list_for_each_entry(clkp, &clock_list, node) {
-               if (likely(clkp->ops)) {
+               if (likely(clkp->usecount && clkp->ops)) {
                        unsigned long rate = clkp->rate;
 
                        if (likely(clkp->ops->set_parent))