]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP2/3 clock: every clock must have a clkdm
authorPaul Walmsley <paul@pwsan.com>
Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 7 Jan 2009 15:23:45 +0000 (17:23 +0200)
Every OMAP2/3 clock must now have an assigned clockdomain, so we can
remove the checks from clk_enable()/clk_disable().  Instead, verify
that the clockdomain is present only at clock init time via the
arch_clock clk_register() hook.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c

index 5f54e7eabe270a2ecf7bddd4178cb088dbdf29c1..1979d5fc9ccef60494bb8cc4a0a3b7190ae80ea0 100644 (file)
@@ -200,11 +200,6 @@ void omap2_init_clk_clkdm(struct clk *clk)
 {
        struct clockdomain *clkdm;
 
-       if (!clk->clkdm.name) {
-               pr_err("clock: %s: missing clockdomain", clk->name);
-               return;
-       }
-
        clkdm = clkdm_lookup(clk->clkdm.name);
        if (clkdm) {
                pr_debug("clock: associated clk %s to clkdm %s\n",
@@ -481,8 +476,7 @@ void omap2_clk_disable(struct clk *clk)
                _omap2_clk_disable(clk);
                if (clk->parent)
                        omap2_clk_disable(clk->parent);
-               if (clk->clkdm.ptr)
-                       omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
+               omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
 
        }
 }
@@ -500,14 +494,12 @@ int omap2_clk_enable(struct clk *clk)
                        return ret;
                }
 
-               if (clk->clkdm.ptr)
-                       omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
+               omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
 
                ret = _omap2_clk_enable(clk);
 
                if (ret != 0) {
-                       if (clk->clkdm.ptr)
-                               omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
+                       omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
 
                        if (clk->parent) {
                                omap2_clk_disable(clk->parent);
@@ -1088,6 +1080,12 @@ void omap2_clk_disable_unused(struct clk *clk)
 
 int omap2_clk_register(struct clk *clk)
 {
+       if (!clk->clkdm.name) {
+               pr_debug("clock: %s: missing clockdomain", clk->name);
+               WARN_ON(1);
+               return -EINVAL;
+       }
+
        omap2_init_clk_clkdm(clk);
        return 0;
 }