summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2019-02-22 10:09:21 +0100
committerMark Brown <broonie@kernel.org>2019-02-22 16:16:33 +0100
commitd3d1a6a72b2337437f13be75c64af4ecc386661f (patch)
treef362958c5cff17852f0e79ca0763c8cc048ae40c /drivers/regulator
parentregulator: tps65218: Add support for LS2 (diff)
downloadlinux-d3d1a6a72b2337437f13be75c64af4ecc386661f.tar.xz
linux-d3d1a6a72b2337437f13be75c64af4ecc386661f.zip
regulator: max77650: Fix set_current_limit implementation
Current code always return error, fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max77650-regulator.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c
index 411912d5278b..a1af414db751 100644
--- a/drivers/regulator/max77650-regulator.c
+++ b/drivers/regulator/max77650-regulator.c
@@ -243,7 +243,7 @@ static int max77650_regulator_set_current_limit(struct regulator_dev *rdev,
{
struct max77650_regulator_desc *rdesc;
struct regmap *map;
- int rv, i, limit;
+ int i, limit;
rdesc = rdev_get_drvdata(rdev);
map = rdev_get_regmap(rdev);
@@ -252,11 +252,9 @@ static int max77650_regulator_set_current_limit(struct regulator_dev *rdev,
limit = max77650_current_limit_table[i];
if (limit >= min_uA && limit <= max_uA) {
- rv = regmap_update_bits(map, rdesc->regA,
+ return regmap_update_bits(map, rdesc->regA,
MAX77650_REGULATOR_CURR_LIM_MASK,
MAX77650_REGULATOR_CURR_LIM_SHIFT(i));
- if (rv)
- return rv;
}
}