提交 cb619e80 编写于 作者: C Colin Ian King 提交者: Sebastian Reichel

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: d20267c9 ("power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
上级 bcfb7ae3
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部