summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm8350-regulator.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-11-18 22:56:17 +0100
committerMark Brown <broonie@kernel.org>2018-11-19 13:33:17 +0100
commitf8702f9e4aa7b45131af3df5531d6e3835269141 (patch)
tree60c485ee3dac05b6eca89f5dc4f6058d84badfd0 /drivers/regulator/wm8350-regulator.c
parentregulator: core: Decouple regulators on regulator_unregister() (diff)
downloadlinux-f8702f9e4aa7b45131af3df5531d6e3835269141.tar.xz
linux-f8702f9e4aa7b45131af3df5531d6e3835269141.zip
regulator: core: Use ww_mutex for regulators locking
Wait/wound mutex shall be used in order to avoid lockups on locking of coupled regulators. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Suggested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/wm8350-regulator.c')
-rw-r--r--drivers/regulator/wm8350-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 8ad11b074b49..a1c7dfee5c37 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -1153,7 +1153,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data)
{
struct regulator_dev *rdev = (struct regulator_dev *)data;
- mutex_lock(&rdev->mutex);
+ regulator_lock(rdev);
if (irq == WM8350_IRQ_CS1 || irq == WM8350_IRQ_CS2)
regulator_notifier_call_chain(rdev,
REGULATOR_EVENT_REGULATION_OUT,
@@ -1162,7 +1162,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data)
regulator_notifier_call_chain(rdev,
REGULATOR_EVENT_UNDER_VOLTAGE,
NULL);
- mutex_unlock(&rdev->mutex);
+ regulator_unlock(rdev);
return IRQ_HANDLED;
}