Merge tag 'for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power...
[linux-2.6-microblaze.git] / drivers / regulator / pv88090-regulator.c
index 6e97cc6..b1d0d97 100644 (file)
@@ -1,17 +1,7 @@
-/*
- * pv88090-regulator.c - Regulator device driver for PV88090
- * Copyright (C) 2015  Powerventure Semiconductor Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// pv88090-regulator.c - Regulator device driver for PV88090
+// Copyright (C) 2015  Powerventure Semiconductor Ltd.
 
 #include <linux/err.h>
 #include <linux/i2c.h>
@@ -237,9 +227,11 @@ static irqreturn_t pv88090_irq_handler(int irq, void *data)
        if (reg_val & PV88090_E_VDD_FLT) {
                for (i = 0; i < PV88090_MAX_REGULATORS; i++) {
                        if (chip->rdev[i] != NULL) {
+                               regulator_lock(chip->rdev[i]);
                                regulator_notifier_call_chain(chip->rdev[i],
                                        REGULATOR_EVENT_UNDER_VOLTAGE,
                                        NULL);
+                               regulator_unlock(chip->rdev[i]);
                        }
                }
 
@@ -254,9 +246,11 @@ static irqreturn_t pv88090_irq_handler(int irq, void *data)
        if (reg_val & PV88090_E_OVER_TEMP) {
                for (i = 0; i < PV88090_MAX_REGULATORS; i++) {
                        if (chip->rdev[i] != NULL) {
+                               regulator_lock(chip->rdev[i]);
                                regulator_notifier_call_chain(chip->rdev[i],
                                        REGULATOR_EVENT_OVER_TEMP,
                                        NULL);
+                               regulator_unlock(chip->rdev[i]);
                        }
                }