From: Mark Brown Date: Fri, 24 Jul 2015 15:19:25 +0000 (+0100) Subject: Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973',... X-Git-Tag: v4.2-rc4~15^2 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/4c7d83e8a8106d90d4eff971c8d070f718ac4f9c?hp=-c Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973', 'regulator/fix/s2mps11' and 'regulator/fix/supply' into regulator-linus --- 4c7d83e8a8106d90d4eff971c8d070f718ac4f9c diff --combined drivers/regulator/core.c index bb8528dfad8c,c9f72019bd68,c9f72019bd68,c9f72019bd68,80a123e8d0c3..78387a6cbae5 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@@@@@ -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 */ @@@@@@ -1402,8 -1398,8 -1398,8 -1398,8 -1402,11 +1406,11 @@@@@@ /* 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;