Skip to contentSkip to conversation

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

PATCH In review Mike Looijmans 2 participants 2 messages Feb 11, 2015 – Feb 25, 2015

lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/power/ltc2941-battery-gauge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/ltc2941-battery-gauge.c +1 -1
index e4a9c87..784ff0b 100644
@@ -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));
 	}
 
Signature · 1 line
1.9.1
#1 lore raw

Hi,

Quoted 2 lines · Mike Looijmans

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