diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-08 11:49:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-08 11:49:30 -0700 |
commit | 1eef1600af5f7404505f217513946e04c6b95718 (patch) | |
tree | 77d48fa50536643242c09b244f89add9a940cc39 /drivers | |
parent | 789505b05752239d957dbfa84b183e0d7a641952 (diff) | |
parent | 968c2c1707a3396ccd6e7e6c5ddaf658a6d3bd66 (diff) | |
download | linux-1eef1600af5f7404505f217513946e04c6b95718.tar.gz linux-1eef1600af5f7404505f217513946e04c6b95718.tar.bz2 linux-1eef1600af5f7404505f217513946e04c6b95718.zip |
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown:
"One small fix for an edge condition in the max8997 driver and a fix
for a surprise in the devres API which caused devm_regulator_put() to
not actually put the regulator - a nicer version of this based on an
improvement of the devres API is queued for 3.5."
* tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: Actually free the regulator in devm_regulator_put()
regulator: Fix the logic to ensure new voltage setting in valid range
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/core.c | 5 | ||||
-rw-r--r-- | drivers/regulator/max8997.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e70dd382a009..046fb1bd8619 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator) rc = devres_destroy(regulator->dev, devm_regulator_release, devm_regulator_match, regulator); - WARN_ON(rc); + if (rc == 0) + regulator_put(regulator); + else + WARN_ON(rc); } EXPORT_SYMBOL_GPL(devm_regulator_put); diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 96579296f04d..17a58c56eebf 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -684,7 +684,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, } new_val++; - } while (desc->min + desc->step + new_val <= desc->max); + } while (desc->min + desc->step * new_val <= desc->max); new_idx = tmp_idx; new_val = tmp_val; |