Skip to content

Commit

Permalink
bq27000: report missing device better.
Browse files Browse the repository at this point in the history
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: NeilBrown <neilb@suse.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
Marek Belisko authored and Sebastian Reichel committed Jul 18, 2014
1 parent 1cb82fd commit 3dd843e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ static void bq27x00_update(struct bq27x00_device_info *di)
bool is_bq27425 = di->chip == BQ27425;

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 (!is_bq27500 && !is_bq27425
&& (cache.flags & BQ27000_FLAG_CI)) {
Expand Down

0 comments on commit 3dd843e

Please sign in to comment.