diff options
Diffstat (limited to 'drivers/regulator')
-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) | |||
1431 | 1431 | ||
1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, | 1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, |
1433 | devm_regulator_match, regulator); | 1433 | devm_regulator_match, regulator); |
1434 | WARN_ON(rc); | 1434 | if (rc == 0) |
1435 | regulator_put(regulator); | ||
1436 | else | ||
1437 | WARN_ON(rc); | ||
1435 | } | 1438 | } |
1436 | EXPORT_SYMBOL_GPL(devm_regulator_put); | 1439 | EXPORT_SYMBOL_GPL(devm_regulator_put); |
1437 | 1440 | ||
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, | |||
684 | } | 684 | } |
685 | 685 | ||
686 | new_val++; | 686 | new_val++; |
687 | } while (desc->min + desc->step + new_val <= desc->max); | 687 | } while (desc->min + desc->step * new_val <= desc->max); |
688 | 688 | ||
689 | new_idx = tmp_idx; | 689 | new_idx = tmp_idx; |
690 | new_val = tmp_val; | 690 | new_val = tmp_val; |