The patch

   regulator: max77650: Fix set_current_limit implementation

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From d3d1a6a72b2337437f13be75c64af4ecc386661f Mon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Fri, 22 Feb 2019 17:09:21 +0800
Subject: [PATCH] regulator: max77650: Fix set_current_limit implementation

Current code always return error, fix it.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
---
 drivers/regulator/max77650-regulator.c | 6 ++----
 1 file 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;
                }
        }
 
-- 
2.20.1

Reply via email to