All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Enric Balletbo Serra <enric.balletbo@collabora.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	linux-pm@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] power: supply: ucs1002: Fix wrong return value checking
Date: Thu,  9 May 2019 20:56:14 +0800	[thread overview]
Message-ID: <20190509125614.28921-1-axel.lin@ingics.com> (raw)

Fix wrong return value checking for devm_regulator_register and
devm_regmap_init_i2c. This looks like a copy-n-paste mistake.

Fixes: 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
This patch replaces my previous patches:
[PATCH] power: supply: ucs1002: Fix checking return value of devm_regulator_register
[PATCH] power: supply: ucs1002: Fix checking return value of devm_regmap_init_i2c

BTW, I though Fixes tag is mainly for backport stable commit which is not this case.
Anyway, added fixes tag base on the comment of Enric Balletbo i Serra.

 drivers/power/supply/ucs1002_power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/supply/ucs1002_power.c b/drivers/power/supply/ucs1002_power.c
index d66b4eff9b7a..1c89d030c045 100644
--- a/drivers/power/supply/ucs1002_power.c
+++ b/drivers/power/supply/ucs1002_power.c
@@ -508,7 +508,7 @@ static int ucs1002_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	info->regmap = devm_regmap_init_i2c(client, &regmap_config);
-	ret = PTR_ERR_OR_ZERO(info->charger);
+	ret = PTR_ERR_OR_ZERO(info->regmap);
 	if (ret) {
 		dev_err(dev, "Regmap initialization failed: %d\n", ret);
 		return ret;
@@ -592,7 +592,7 @@ static int ucs1002_probe(struct i2c_client *client,
 
 	rdev = devm_regulator_register(dev, info->regulator_descriptor,
 				       &regulator_config);
-	ret = PTR_ERR_OR_ZERO(info->charger);
+	ret = PTR_ERR_OR_ZERO(rdev);
 	if (ret) {
 		dev_err(dev, "Failed to register VBUS regulator: %d\n", ret);
 		return ret;
-- 
2.20.1


             reply	other threads:[~2019-05-09 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 12:56 Axel Lin [this message]
2019-05-09 19:14 ` [PATCH] power: supply: ucs1002: Fix wrong return value checking Andrey Smirnov
2019-05-09 19:44   ` Sebastian Reichel

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=20190509125614.28921-1-axel.lin@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.