diff options
author | NeilBrown <neilb@suse.de> | 2013-02-15 12:56:38 +1100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2013-03-09 20:27:49 +0100 |
commit | c627edb0a5b57572280297a2d1f70febe2d93f2b (patch) | |
tree | e436e2b22bf81abe4e33dffa78a8f3fc9d1343ed /drivers/power | |
parent | af7dd107ef4bcedfc56e8426fef9973cbfb6de92 (diff) | |
download | kernel_goldelico_gta04-c627edb0a5b57572280297a2d1f70febe2d93f2b.zip kernel_goldelico_gta04-c627edb0a5b57572280297a2d1f70febe2d93f2b.tar.gz kernel_goldelico_gta04-c627edb0a5b57572280297a2d1f70febe2d93f2b.tar.bz2 |
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: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/bq27x00_battery.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index 2a3e13d..96d64c66e 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c @@ -422,10 +422,13 @@ static void bq27x00_update(struct bq27x00_device_info *di) int flags_changed; 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)) { - dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n"); + dev_dbg(di->dev, "battery is not calibrated! ignoring capacity values\n"); cache.capacity = -ENODATA; cache.energy = -ENODATA; cache.time_to_empty = -ENODATA; |