From: Mattias Wallin Date: Thu, 4 Nov 2010 10:01:31 +0000 (+0100) Subject: regulator: lock supply in regulator enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3aa713e76e8f562c0d28faf18873c4f1836b17c9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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);