power: supply: ucs1002: Fix checking return value of devm_regmap_init_i2c
diff mbox series

Message ID 20190509123047.27466-1-axel.lin@ingics.com
State Not Applicable, archived
Headers show
Series
  • power: supply: ucs1002: Fix checking return value of devm_regmap_init_i2c
Related show

Commit Message

Axel Lin May 9, 2019, 12:30 p.m. UTC
Current code checks wrong return value, it should check info->regmap rather
than info->charger. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/power/supply/ucs1002_power.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/power/supply/ucs1002_power.c b/drivers/power/supply/ucs1002_power.c
index 33409b13232a..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;