power: supply: ucs1002: Fix checking return value of devm_regulator_register
PATCH 1/1 power: supply: ucs1002: Fix checking return value of devm_regulator_register
Current code checks wrong return value, it should check rdev rather than info->charger. Fix it.
Signed-off-by Axel Lin <[email protected]>
--- drivers/power/supply/ucs1002_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/ucs1002_power.c +1 -1
@@ -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;
Signature · 1 line
2.20.1
Hi Axel,
Probably makes sense squash the both patches that you sent regarding ucs1002.
Quoted 3 lines · Axel Lin
Current code checks wrong return value, it should check rdev rather than
info->charger. Fix it.
That should probably include a Fixes tag.
Quoted 1 line
Signed-off-by Axel Lin <[email protected]>
The change itself:
Reviewed-by Enric Balletbo i Serra <[email protected]>
Quoted 10 lines
--- drivers/power/supply/ucs1002_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/power/supply/ucs1002_power.c +0
-0
drivers/power/supply/ucs1002_power.c static int ucs1002_probe(struct i2c_client *client, · line 598
Quoted 8 lines
drivers/power/supply/ucs1002_power.c +1
-1@@ -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;
Thanks,
Enric