aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2009-08-26 06:54:04 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 08:32:43 -0400
commita7433cff9ed8e7982de8e0f210f0325d0f3d1949 (patch)
treebee9e9a62dace73825fece589dc32c82a95ae02c /drivers/regulator
parent9e108d33edcb88bac3db39ba1683fc2c0591d7d4 (diff)
REGULATOR Handle positive returncode from enable
This makes _regulator_enable() properly handle the case where a regulator is already on when you try to enable it. Currently it will erroneously handle positive return values as an error. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dbf27bf028c4..744ea1d0b59b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1236,11 +1236,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
1236 } else { 1236 } else {
1237 return -EINVAL; 1237 return -EINVAL;
1238 } 1238 }
1239 } else { 1239 } else if (ret < 0) {
1240 printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n", 1240 printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
1241 __func__, rdev->desc->name, ret); 1241 __func__, rdev->desc->name, ret);
1242 return ret; 1242 return ret;
1243 } 1243 }
1244 /* Fallthrough on positive return values - already enabled */
1244 } 1245 }
1245 1246
1246 rdev->use_count++; 1247 rdev->use_count++;