From f59f5bcb605f40d418aceb6f6047069435ffac72 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 10 Aug 2010 10:28:04 +0100 Subject: 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 --- drivers/power/intel_mid_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/power') diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c index 6430a7bb637b..c61ffec2ff10 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; } /** -- cgit v1.2.3