]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/pv88080-regulator.c
udmabuf: separate out creating/destroying scatter-table
[linux.git] / drivers / regulator / pv88080-regulator.c
index bdddacdbeb99698a6545461737e70406b8470672..a444f68af1a867a63fe50e559e086f8956a0f421 100644 (file)
@@ -1,17 +1,7 @@
-/*
- * pv88080-regulator.c - Regulator device driver for PV88080
- * Copyright (C) 2016  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+
+//
+// pv88080-regulator.c - Regulator device driver for PV88080
+// Copyright (C) 2016  Powerventure Semiconductor Ltd.
 
 #include <linux/err.h>
 #include <linux/i2c.h>
@@ -345,9 +335,11 @@ static irqreturn_t pv88080_irq_handler(int irq, void *data)
        if (reg_val & PV88080_E_VDD_FLT) {
                for (i = 0; i < PV88080_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]);
                        }
                }
 
@@ -362,9 +354,11 @@ static irqreturn_t pv88080_irq_handler(int irq, void *data)
        if (reg_val & PV88080_E_OVER_TEMP) {
                for (i = 0; i < PV88080_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]);
                        }
                }