提交 8ada4e0e 编写于 作者: S Steve Rae 提交者: Tom Rini

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: NChris Brand <chris.brand@broadcom.com>
Signed-off-by: NSteve Rae <srae@broadcom.com>
上级 77a1a677
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册