mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: max77650: Fix set_current_limit implementation
@ 2019-02-22  9:09 Axel Lin
  2019-02-22  9:16 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2019-02-22  9:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: Bartosz Golaszewski, Liam Girdwood, linux-kernel, Axel Lin

Current code always return error, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 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.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: max77650: Fix set_current_limit implementation
  2019-02-22  9:09 [PATCH] regulator: max77650: Fix set_current_limit implementation Axel Lin
@ 2019-02-22  9:16 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-02-22  9:16 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, LKML

pt., 22 lut 2019 o 10:09 Axel Lin <axel.lin@ingics.com> napisał(a):
>
> Current code always return error, fix it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  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.17.1
>

Thanks for spotting that!

Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-22  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22  9:09 [PATCH] regulator: max77650: Fix set_current_limit implementation Axel Lin
2019-02-22  9:16 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®