diff options
author | Mark Brown <broonie@kernel.org> | 2019-02-19 14:06:41 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-02-19 14:06:41 +0300 |
commit | 16646d8d3d66e0a89528f72a28a23023b054417d (patch) | |
tree | 6620abf1d2021486f30e7036324e4de6f0b14321 /drivers/regulator/core.c | |
parent | e6fff62ab8ac81fe42c407b1b2cfbffcb50c7d01 (diff) | |
parent | 48593a99a1f6245000fa90606dd9ec5eb96b54a6 (diff) | |
download | linux-16646d8d3d66e0a89528f72a28a23023b054417d.tar.xz |
Merge branch 'regulator-5.0' into regulator-5.1 stpmic1 const/range
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3e9aa0d0b471..9cf09666616f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1337,7 +1337,9 @@ static int set_machine_constraints(struct regulator_dev *rdev, * We'll only apply the initial system load if an * initial mode wasn't specified. */ + regulator_lock(rdev); drms_uA_update(rdev); + regulator_unlock(rdev); } if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable) @@ -2046,15 +2048,7 @@ static void _regulator_put(struct regulator *regulator) debugfs_remove_recursive(regulator->debugfs); if (regulator->dev) { - int count = 0; - struct regulator *r; - - list_for_each_entry(r, &rdev->consumer_list, list) - if (r->dev == regulator->dev) - count++; - - if (count == 1) - device_link_remove(regulator->dev, &rdev->dev); + device_link_remove(regulator->dev, &rdev->dev); /* remove any sysfs entries */ sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name); |