lkml.org 
[lkml]   [2009]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH F 10/12] OMAP2/3 clock: omap2_clk_enable(): fix logic
Date
Rearrange the parent clock enable status check code so it actually makes
sense. No functional change.

linux-omap source commit is 8f0680aff352906b81c49b0450172ffa690b03bb.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/clock.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 5f17a2c..72e3db8 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -481,20 +481,23 @@ void omap2_clk_disable(struct clk *clk)

int omap2_clk_enable(struct clk *clk)
{
- int ret = 0;
+ int ret;

if (++clk->usecount > 1)
return 0;

omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);

- if (clk->parent)
- ret = omap2_clk_enable(clk->parent);
+ if (clk->parent) {
+ int parent_ret;

- if (ret != 0) {
- clk->usecount--;
- omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
- return ret;
+ parent_ret = omap2_clk_enable(clk->parent);
+
+ if (parent_ret != 0) {
+ clk->usecount--;
+ omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
+ return parent_ret;
+ }
}

ret = _omap2_clk_enable(clk);



\
 
 \ /
  Last update: 2009-01-28 21:55    [from the cache]
©2003-2011 Jasper Spaans