1
0
Fork 0

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>
hifive-unleashed-5.1
Axel Lin 2019-02-22 17:09:21 +08:00 committed by Mark Brown
parent e5c8ba0635
commit d3d1a6a72b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}
}