Commit 09eb8b7c authored by Axel Lin's avatar Axel Lin Committed by Sebastian Reichel

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: 9a2688e4 ("power: supply: Add driver for Microchip UCS1002")
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 9a2688e4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment