Skip to contentSkip to conversation

power: supply: ucs1002: Fix wrong return value checking

PATCH In review Axel Lin 3 participants 3 messages May 9, 2019 Power supply

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 power: supply: ucs1002: Fix wrong return value checking

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")

---
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(-)
drivers/power/supply/ucs1002_power.c +2 -2
index d66b4eff9b7a..1c89d030c045 100644
@@ -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;
Signature · 1 line
2.20.1
#2 lore raw

Hi,

Quoted 5 lines · Andrey Smirnov
Quoted 4 lines · Axel Lin

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

Quoted 7 lines
Quoted 3 lines
Fixes 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002")

Ugh, sorry about that.

Thanks, queued.

-- Sebastian