lkml.org 
[lkml]   [2009]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[rfc/patch 13/15] power: bq27200: RSOC is 8-bit wide
Date
no need for shifting, just read 8-bits.

Signed-off-by: Felipe Balbi <me@felipebalbi.com>
---
drivers/power/bq27200_battery.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/bq27200_battery.c b/drivers/power/bq27200_battery.c
index dd1b2f2..85e824a 100644
--- a/drivers/power/bq27200_battery.c
+++ b/drivers/power/bq27200_battery.c
@@ -159,13 +159,13 @@ static int bq27200_rsoc(struct bq27200 *bq)
{
int ret;

- ret = bq27200_readw(bq, BQ27200_REG_RSOC);
+ ret = bq27200_readb(bq, BQ27200_REG_RSOC);
if (ret < 0) {
dev_err(&bq->client->dev, "error reading relative State-of-Charge\n");
return ret;
}

- return ret >> 8;
+ return ret;
}

static int bq27200_power(struct bq27200 *bq)
--
1.6.1.3


\
 
 \ /
  Last update: 2009-07-12 20:33    [W:0.061 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site