summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMattias Wallin <mattias.wallin@stericsson.com>2010-11-04 11:01:31 +0100
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-11-30 15:13:25 +0000
commit3aa713e76e8f562c0d28faf18873c4f1836b17c9 (patch)
treeb4de8864beeb9df897350bd121218d51012b1668 /drivers/regulator/core.c
parent7727da22e820a96ab394db2fc0ab58f7f7ecb323 (diff)
regulator: lock supply in regulator enable
This patch add locks around regulator supply enable. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 711fa1722bce..27d062e1395c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1269,7 +1269,9 @@ static int _regulator_enable(struct regulator_dev *rdev)
/* do we need to enable the supply regulator first */
if (rdev->supply) {
+ mutex_lock(&rdev->supply->mutex);
ret = _regulator_enable(rdev->supply);
+ mutex_unlock(&rdev->supply->mutex);
if (ret < 0) {
printk(KERN_ERR "%s: failed to enable %s: %d\n",
__func__, rdev_get_name(rdev), ret);