intel_mid_battery: Fix battery scaling
authorAlan Cox <alan@linux.intel.com>
Tue, 10 Aug 2010 09:28:04 +0000 (10:28 +0100)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Tue, 10 Aug 2010 10:35:27 +0000 (14:35 +0400)
There are 3600 seconds per not 3600 hours per second. Correcting this
along with the previous fix gives sensible numbers.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/intel_mid_battery.c

index 6430a7bb637b28e3807a39ec6ac62836744a9685..c61ffec2ff106ca7aa153dac55cebf5a77b495b1 100644 (file)
@@ -427,7 +427,7 @@ static int pmic_usb_get_property(struct power_supply *psy,
 static inline unsigned long mAStouAh(unsigned long v)
 {
        /* seconds to hours, mA to µA */
-       return v * 3600 * 1000;
+       return (v * 1000) / 3600;
 }
 
 /**