Commit 60b8b431 authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP2/3 clock: every clock must have a clkdm

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: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 12081fce
...@@ -200,11 +200,6 @@ void omap2_init_clk_clkdm(struct clk *clk) ...@@ -200,11 +200,6 @@ void omap2_init_clk_clkdm(struct clk *clk)
{ {
struct clockdomain *clkdm; struct clockdomain *clkdm;
if (!clk->clkdm.name) {
pr_err("clock: %s: missing clockdomain", clk->name);
return;
}
clkdm = clkdm_lookup(clk->clkdm.name); clkdm = clkdm_lookup(clk->clkdm.name);
if (clkdm) { if (clkdm) {
pr_debug("clock: associated clk %s to clkdm %s\n", pr_debug("clock: associated clk %s to clkdm %s\n",
...@@ -481,7 +476,6 @@ void omap2_clk_disable(struct clk *clk) ...@@ -481,7 +476,6 @@ void omap2_clk_disable(struct clk *clk)
_omap2_clk_disable(clk); _omap2_clk_disable(clk);
if (clk->parent) if (clk->parent)
omap2_clk_disable(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,13 +494,11 @@ int omap2_clk_enable(struct clk *clk) ...@@ -500,13 +494,11 @@ int omap2_clk_enable(struct clk *clk)
return ret; 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); ret = _omap2_clk_enable(clk);
if (ret != 0) { 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) { if (clk->parent) {
...@@ -1088,6 +1080,12 @@ void omap2_clk_disable_unused(struct clk *clk) ...@@ -1088,6 +1080,12 @@ void omap2_clk_disable_unused(struct clk *clk)
int omap2_clk_register(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); omap2_init_clk_clkdm(clk);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment