Skip to content

Commit cb619e8

Browse files
Colin Ian Kingsre
authored andcommitted
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: d20267c ("power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent bcfb7ae commit cb619e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/power/supply/bq25890_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static int bq25890_get_chip_version(struct bq25890_device *bq)
765765
rev = bq25890_field_read(bq, F_DEV_REV);
766766
if (rev < 0) {
767767
dev_err(bq->dev, "Cannot read chip revision.\n");
768-
return id;
768+
return rev;
769769
}
770770

771771
switch (id) {

0 commit comments

Comments
 (0)