From: Alan Cox Date: Tue, 10 Aug 2010 09:28:04 +0000 (+0100) Subject: intel_mid_battery: Fix battery scaling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f59f5bcb605f40d418aceb6f6047069435ffac72;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git intel_mid_battery: Fix battery scaling 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 Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c index 6430a7bb637..c61ffec2ff1 100644 --- a/drivers/power/intel_mid_battery.c +++ b/drivers/power/intel_mid_battery.c @@ -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; } /**