Message ID | 20190509125614.28921-1-axel.lin@ingics.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | power: supply: ucs1002: Fix wrong return value checking | expand |
On Thu, May 9, 2019 at 5:56 AM Axel Lin <axel.lin@ingics.com> wrote: > > 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> Ugh, sorry about that. Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Hi, On Thu, May 09, 2019 at 12:14:24PM -0700, Andrey Smirnov wrote: > On Thu, May 9, 2019 at 5:56 AM Axel Lin <axel.lin@ingics.com> wrote: > > > > 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> > > Ugh, sorry about that. > > Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com> Thanks, queued. -- Sebastian
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, ®map_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, ®ulator_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;