diff mbox

ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85)

Message ID 1423654611-10906-1-git-send-email-mike.looijmans@topic.nl (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Mike Looijmans Feb. 11, 2015, 11:36 a.m. UTC
The driver reported 30% less than actually measured. This turned out to
be caused by a simple typo in the formula to calculate the LSB quantity.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---
 drivers/power/ltc2941-battery-gauge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sebastian Reichel Feb. 25, 2015, 9:55 p.m. UTC | #1
Hi,

On Wed, Feb 11, 2015 at 12:36:51PM +0100, Mike Looijmans wrote:
> The driver reported 30% less than actually measured. This turned out to
> be caused by a simple typo in the formula to calculate the LSB quantity.

This is in my for-next queue since some time already and will be
send to Torvalds in my 4.0-rc pull request.

-- Sebastian
diff mbox

Patch

diff --git a/drivers/power/ltc2941-battery-gauge.c b/drivers/power/ltc2941-battery-gauge.c
index e4a9c87..784ff0b 100644
--- a/drivers/power/ltc2941-battery-gauge.c
+++ b/drivers/power/ltc2941-battery-gauge.c
@@ -439,7 +439,7 @@  static int ltc294x_i2c_probe(struct i2c_client *client,
 	} else {
 		if (prescaler_exp > LTC2941_MAX_PRESCALER_EXP)
 			prescaler_exp = LTC2941_MAX_PRESCALER_EXP;
-		info->Qlsb = ((58 * 50000) / r_sense) /
+		info->Qlsb = ((85 * 50000) / r_sense) /
 				(128 / (1 << prescaler_exp));
 	}