summaryrefslogtreecommitdiff
path: root/drivers/regulator/reg-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/reg-core.c')
-rw-r--r--drivers/regulator/reg-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/reg-core.c b/drivers/regulator/reg-core.c
index ecc94b6fea6a..afaf68457ba7 100644
--- a/drivers/regulator/reg-core.c
+++ b/drivers/regulator/reg-core.c
@@ -390,8 +390,7 @@ static int __regulator_disable(struct regulator *regulator)
{
int ret = 0;
- if (regulator->use_count == 1) {
-
+ if (regulator->use_count > 0 && !(--regulator->use_count)) {
if (regulator->ops->disable) {
ret = regulator->ops->disable(regulator);
if (ret < 0)
@@ -400,7 +399,6 @@ static int __regulator_disable(struct regulator *regulator)
if (regulator->parent)
__regulator_disable(regulator->parent);
}
- regulator->use_count--;
out:
return ret;
}