Commit d12cfac1 authored by Magnus Damm's avatar Magnus Damm Committed by Paul Mundt

sh: enable and disable clocks recursively

Recurse and make sure parent clocks get enabled/disabled.
Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 4a4a9be3
...@@ -117,6 +117,11 @@ int clk_enable(struct clk *clk) ...@@ -117,6 +117,11 @@ int clk_enable(struct clk *clk)
unsigned long flags; unsigned long flags;
int ret; int ret;
if (!clk)
return -EINVAL;
clk_enable(clk->parent);
spin_lock_irqsave(&clock_lock, flags); spin_lock_irqsave(&clock_lock, flags);
ret = __clk_enable(clk); ret = __clk_enable(clk);
spin_unlock_irqrestore(&clock_lock, flags); spin_unlock_irqrestore(&clock_lock, flags);
...@@ -147,9 +152,14 @@ void clk_disable(struct clk *clk) ...@@ -147,9 +152,14 @@ void clk_disable(struct clk *clk)
{ {
unsigned long flags; unsigned long flags;
if (!clk)
return -EINVAL;
spin_lock_irqsave(&clock_lock, flags); spin_lock_irqsave(&clock_lock, flags);
__clk_disable(clk); __clk_disable(clk);
spin_unlock_irqrestore(&clock_lock, flags); spin_unlock_irqrestore(&clock_lock, flags);
clk_disable(clk->parent);
} }
EXPORT_SYMBOL_GPL(clk_disable); EXPORT_SYMBOL_GPL(clk_disable);
......
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