]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/pv88060-regulator.c
Merge branch 'parisc-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[linux.git] / drivers / regulator / pv88060-regulator.c
index 1600f982189129ad264d5f8ede15b4b51c5e32aa..3d3415839ba242aba2407173e81a332ae85b2466 100644 (file)
@@ -1,17 +1,7 @@
-/*
- * pv88060-regulator.c - Regulator device driver for PV88060
- * 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+
+//
+// pv88060-regulator.c - Regulator device driver for PV88060
+// Copyright (C) 2015  Powerventure Semiconductor Ltd.
 
 #include <linux/err.h>
 #include <linux/i2c.h>
@@ -244,9 +234,11 @@ static irqreturn_t pv88060_irq_handler(int irq, void *data)
        if (reg_val & PV88060_E_VDD_FLT) {
                for (i = 0; i < PV88060_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]);
                        }
                }
 
@@ -261,9 +253,11 @@ static irqreturn_t pv88060_irq_handler(int irq, void *data)
        if (reg_val & PV88060_E_OVER_TEMP) {
                for (i = 0; i < PV88060_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]);
                        }
                }