Browse Source

drivers: sh: resume enabled clocks fix

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>
Magnus Damm 14 years ago
parent
commit
583af252ab
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/sh/clk/core.c

+ 1 - 1
drivers/sh/clk/core.c

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