lkml.org 
[lkml]   [2014]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] bq27000: report missing device better.
From
CCing lkml

On Mon, Jun 30, 2014 at 9:49 PM, Marek Belisko <marek@goldelico.com> wrote:
> 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>
> ---
> drivers/power/bq27x00_battery.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
> index 27bac1d..aa80efc 100644
> --- a/drivers/power/bq27x00_battery.c
> +++ b/drivers/power/bq27x00_battery.c
> @@ -420,6 +420,9 @@ 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)) {
> --
> 1.9.1
>



--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com


\
 
 \ /
  Last update: 2014-06-30 22:41    [W:0.031 / U:5.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site