]> Git Repo - linux.git/commitdiff
Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973',...
authorMark Brown <[email protected]>
Fri, 24 Jul 2015 15:19:25 +0000 (16:19 +0100)
committerMark Brown <[email protected]>
Fri, 24 Jul 2015 15:19:25 +0000 (16:19 +0100)
1  2  3  4  5 
drivers/regulator/core.c

diff --combined drivers/regulator/core.c
index bb8528dfad8c8ea3f449f6d19738bfe6f1a5674b,c9f72019bd689afbb4e51528932689dc097b191b,c9f72019bd689afbb4e51528932689dc097b191b,c9f72019bd689afbb4e51528932689dc097b191b,80a123e8d0c33b94eed6f29b769fda0ff1b16aef..78387a6cbae59e40a6fb05fc255647cacfe3209b
@@@@@@ -109,6 -109,6 -109,6 -109,6 -109,7 +109,7 @@@@@@ static int _regulator_do_set_voltage(st
     static struct regulator *create_regulator(struct regulator_dev *rdev,
                                          struct device *dev,
                                          const char *supply_name);
++++ static void _regulator_put(struct regulator *regulator);
     
     static const char *rdev_get_name(struct regulator_dev *rdev)
     {
@@@@@@ -1105,6 -1105,6 -1105,6 -1105,6 -1106,9 +1106,9 @@@@@@ static int set_supply(struct regulator_
     
        rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));
     
++++    if (!try_module_get(supply_rdev->owner))
++++            return -ENODEV;
++++ 
        rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
        if (rdev->supply == NULL) {
                err = -ENOMEM;
@@@@@@ -1381,13 -1381,9 -1381,9 -1381,9 -1385,9 +1385,13 @@@@@@ static int regulator_resolve_supply(str
        }
     
        if (!r) {
 ----           dev_err(dev, "Failed to resolve %s-supply for %s\n",
 ----                   rdev->supply_name, rdev->desc->name);
 ----           return -EPROBE_DEFER;
 ++++           if (have_full_constraints()) {
 ++++                   r = dummy_regulator_rdev;
 ++++           } else {
 ++++                   dev_err(dev, "Failed to resolve %s-supply for %s\n",
 ++++                           rdev->supply_name, rdev->desc->name);
 ++++                   return -EPROBE_DEFER;
 ++++           }
        }
     
        /* Recursively resolve the supply of the supply */
        /* Cascade always-on state to supply */
        if (_regulator_is_enabled(rdev)) {
                ret = regulator_enable(rdev->supply);
----            if (ret < 0)
++++            if (ret < 0) {
++++                    if (rdev->supply)
++++                            _regulator_put(rdev->supply);
                        return ret;
++++            }
        }
     
        return 0;
This page took 0.066239 seconds and 4 git commands to generate.