summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorSteve Rae <srae@broadcom.com>2016-06-21 16:43:07 -0700
committerTom Rini <trini@konsulko.com>2016-06-24 17:24:38 -0400
commit8ada4e0ee652d2108c640a4daaf63865ad8dedb1 (patch)
tree9f8c4c1407385ce045bbf14c8ae40feec917006f /arch/arm
parent77a1a677a6db02377921cda1a146d18efb1f31ec (diff)
downloadu-boot-imx-8ada4e0ee652d2108c640a4daaf63865ad8dedb1.zip
u-boot-imx-8ada4e0ee652d2108c640a4daaf63865ad8dedb1.tar.gz
u-boot-imx-8ada4e0ee652d2108c640a4daaf63865ad8dedb1.tar.bz2
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: Chris Brand <chris.brand@broadcom.com> Signed-off-by: Steve Rae <srae@broadcom.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv7/bcm235xx/clk-core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv7/bcm235xx/clk-core.c b/arch/arm/cpu/armv7/bcm235xx/clk-core.c
index 2b5da6b..a326dfe 100644
--- a/arch/arm/cpu/armv7/bcm235xx/clk-core.c
+++ b/arch/arm/cpu/armv7/bcm235xx/clk-core.c
@@ -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 */