From d8b02935410f2995568594870ba119323587636e Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 7 May 2009 10:31:39 +0000 Subject: [PATCH] --- yaml --- r: 146715 b: refs/heads/master c: b3cacf318172757783d8272fc333284dd4f50140 h: refs/heads/master i: 146713: 089e5677ec8be36ef1e44032df2ca7c8cc733382 146711: 89c257ba4e3ff675ad3f83f85c0c902e7fa28c7a v: v3 --- [refs] | 2 +- trunk/arch/sh/kernel/cpu/clock.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index cd33ede3b470..e5f9e1edabfb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5dafc91fca9135a7b0acb76d9709f4abfad92d6e +refs/heads/master: b3cacf318172757783d8272fc333284dd4f50140 diff --git a/trunk/arch/sh/kernel/cpu/clock.c b/trunk/arch/sh/kernel/cpu/clock.c index 1dc896483b59..099373ae57d8 100644 --- a/trunk/arch/sh/kernel/cpu/clock.c +++ b/trunk/arch/sh/kernel/cpu/clock.c @@ -99,15 +99,18 @@ static int __clk_enable(struct clk *clk) * changes and the clock needs to hunt for the proper set of * divisors to use before it can effectively recalc. */ + + if (clk->flags & CLK_ALWAYS_ENABLED) { + kref_get(&clk->kref); + return 0; + } + if (unlikely(atomic_read(&clk->kref.refcount) == 1)) if (clk->ops && clk->ops->init) clk->ops->init(clk); kref_get(&clk->kref); - if (clk->flags & CLK_ALWAYS_ENABLED) - return 0; - if (likely(clk->ops && clk->ops->enable)) clk->ops->enable(clk);