Commit 3dd843e1 authored by Marek Belisko's avatar Marek Belisko Committed by Sebastian Reichel

bq27000: report missing device better.

One an hdq buss, a missing device reads as 0xff, not -1.
So do a translation to allow detecting of a missing bus.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 1cb82fdb
...@@ -416,6 +416,9 @@ static void bq27x00_update(struct bq27x00_device_info *di) ...@@ -416,6 +416,9 @@ static void bq27x00_update(struct bq27x00_device_info *di)
bool is_bq27425 = di->chip == BQ27425; bool is_bq27425 = di->chip == BQ27425;
cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500); cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500);
if ((cache.flags & 0xff) == 0xff)
/* read error */
cache.flags = -1;
if (cache.flags >= 0) { if (cache.flags >= 0) {
if (!is_bq27500 && !is_bq27425 if (!is_bq27500 && !is_bq27425
&& (cache.flags & BQ27000_FLAG_CI)) { && (cache.flags & BQ27000_FLAG_CI)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment