Skip to content
Snippets Groups Projects
Commit 8ada4e0e authored by Steve Rae's avatar Steve Rae Committed by Tom Rini
Browse files

arm: bcm235xx: update clock framework


The handling of the "usage counter" is incorrect, and the clock should
only be disabled when transitioning from 1 to 0.

Reported-by: default avatarChris Brand <chris.brand@broadcom.com>
Signed-off-by: default avatarSteve Rae <srae@broadcom.com>
parent 77a1a677
No related branches found
No related tags found
No related merge requests found
......@@ -449,10 +449,9 @@ int clk_enable(struct clk *c)
if (ret)
return ret;
if (!c->use_cnt) {
c->use_cnt++;
if (!c->use_cnt)
ret = c->ops->enable(c, 1);
}
c->use_cnt++;
return ret;
}
......@@ -464,9 +463,10 @@ void clk_disable(struct clk *c)
if (!c->ops || !c->ops->enable)
return;
if (c->use_cnt) {
if (c->use_cnt > 0) {
c->use_cnt--;
c->ops->enable(c, 0);
if (c->use_cnt == 0)
c->ops->enable(c, 0);
}
/* disable parent */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment