mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] regulator: max77650: Fix set_current_limit implementation
Date: Fri, 22 Feb 2019 17:09:21 +0800	[thread overview]
Message-ID: <20190222090921.2068-1-axel.lin@ingics.com> (raw)

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


             reply	other threads:[~2019-02-22  9:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  9:09 Axel Lin [this message]
2019-02-22  9:16 ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222090921.2068-1-axel.lin@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®