diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-01-16 18:09:00 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2020-01-16 20:35:57 +0100 |
commit | cb619e80333acc59ce9eb29d56ef6e3b749bf474 (patch) | |
tree | 85ec2dbbc346e1f9cd5d4f50f2b1420aa537e311 /drivers/power | |
parent | power: supply: axp20x_usb_power: Only poll while offline (diff) | |
download | linux-cb619e80333acc59ce9eb29d56ef6e3b749bf474.tar.xz linux-cb619e80333acc59ce9eb29d56ef6e3b749bf474.zip |
power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails
Currently a read failure by bq25890_field_read on F_DEV_REV is returning
an error in id instead of rev. Fix this by returning the value in rev.
Addresses-Coverity: ("Copy-paste error")
Fixes: d20267c9a98e ("power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/supply/bq25890_charger.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index 785dbc6307b0..aebd1253dbc9 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -765,7 +765,7 @@ static int bq25890_get_chip_version(struct bq25890_device *bq) rev = bq25890_field_read(bq, F_DEV_REV); if (rev < 0) { dev_err(bq->dev, "Cannot read chip revision.\n"); - return id; + return rev; } switch (id) { |