From: Mattias Wallin Date: Thu, 4 Nov 2010 10:01:31 +0000 (+0100) Subject: regulator: lock supply in regulator enable X-Git-Tag: v2.6.37-rc5~35^2~3 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3aa713e76e8f562c0d28faf18873c4f1836b17c9;p=~shefty%2Frdma-dev.git regulator: lock supply in regulator enable This patch add locks around regulator supply enable. Signed-off-by: Mattias Wallin Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 711fa1722bc..27d062e1395 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);