]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/ltc3676.c
net: usb: sr9800: fix uninitialized local variable
[linux.git] / drivers / regulator / ltc3676.c
index e6d66e492b8514d4c1e2e4d05ac2275891571691..d934540eb8c4b23813c94ba13eec8447c7ad441e 100644 (file)
@@ -1,15 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (C) 2016 Gateworks Corporation, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * 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.
- *
  */
 #include <linux/i2c.h>
 #include <linux/init.h>
@@ -285,17 +276,23 @@ static irqreturn_t ltc3676_isr(int irq, void *dev_id)
        if (irqstat & LTC3676_IRQSTAT_THERMAL_WARN) {
                dev_warn(dev, "Over-temperature Warning\n");
                event = REGULATOR_EVENT_OVER_TEMP;
-               for (i = 0; i < LTC3676_NUM_REGULATORS; i++)
+               for (i = 0; i < LTC3676_NUM_REGULATORS; i++) {
+                       regulator_lock(ltc3676->regulators[i]);
                        regulator_notifier_call_chain(ltc3676->regulators[i],
                                                      event, NULL);
+                       regulator_unlock(ltc3676->regulators[i]);
+               }
        }
 
        if (irqstat & LTC3676_IRQSTAT_UNDERVOLT_WARN) {
                dev_info(dev, "Undervoltage Warning\n");
                event = REGULATOR_EVENT_UNDER_VOLTAGE;
-               for (i = 0; i < LTC3676_NUM_REGULATORS; i++)
+               for (i = 0; i < LTC3676_NUM_REGULATORS; i++) {
+                       regulator_lock(ltc3676->regulators[i]);
                        regulator_notifier_call_chain(ltc3676->regulators[i],
                                                      event, NULL);
+                       regulator_unlock(ltc3676->regulators[i]);
+               }
        }
 
        /* Clear warning condition */