diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2016-01-12 18:28:51 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-15 19:09:35 +0100 |
commit | 0f48eedacf1914c000c7bebdc44de15412baa6f1 (patch) | |
tree | f74e7d99a92dde130908bcab84d71798bf26220f /drivers/regulator/da9210-regulator.c | |
parent | Linux 4.4-rc1 (diff) | |
download | linux-0f48eedacf1914c000c7bebdc44de15412baa6f1.tar.xz linux-0f48eedacf1914c000c7bebdc44de15412baa6f1.zip |
regulator: da9210: fix lockdep warning
Commit 70cfef26267474 ("regulator: Add lockdep asserts to help detecting
locking misuse") successfully created this WARN, let's fix it:
[ 1.218660] WARNING: CPU: 0 PID: 553 at drivers/regulator/core.c:3646 regulator_notifier_call_chain+0x5c/0x88()
...
[ 1.220278] [<c0246c20>] (regulator_notifier_call_chain) from [<c02498b4>] (da9210_irq_handler+0x74/0x10c)
[ 1.220412] r7:c0080cac r6:eb1daa00 r5:e64bbf10 r4:00000002
[ 1.220547] [<c0249840>] (da9210_irq_handler) from [<c0080cd8>] (irq_thread_fn+0x2c/0x44)
...
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/da9210-regulator.c')
-rw-r--r-- | drivers/regulator/da9210-regulator.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c index b3517830edb6..cfd6e8af67ec 100644 --- a/drivers/regulator/da9210-regulator.c +++ b/drivers/regulator/da9210-regulator.c @@ -132,6 +132,8 @@ static irqreturn_t da9210_irq_handler(int irq, void *data) if (error < 0) goto error_i2c; + mutex_lock(&chip->rdev->mutex); + if (val & DA9210_E_OVCURR) { regulator_notifier_call_chain(chip->rdev, REGULATOR_EVENT_OVER_CURRENT, @@ -155,6 +157,9 @@ static irqreturn_t da9210_irq_handler(int irq, void *data) NULL); handled |= DA9210_E_VMAX; } + + mutex_unlock(&chip->rdev->mutex); + if (handled) { /* Clear handled events */ error = regmap_write(chip->regmap, DA9210_REG_EVENT_B, handled); |