From: Sven Neumann Date: Fri, 12 Nov 2010 10:36:22 +0000 (+0100) Subject: ds2760_battery: Fix calculation of time_to_empty_now X-Git-Tag: v2.6.37.1~126 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39ed1e1ac83399b318f6b026d83fd01342422f23;p=pandora-kernel.git ds2760_battery: Fix calculation of time_to_empty_now commit 86af95039b69a90db15294eb1f9c147f1df0a8ea upstream. A check against division by zero was modified in commit b0525b48. Since this change time_to_empty_now is always reported as zero while the battery is discharging and as a negative value while the battery is charging. This is because current is negative while the battery is discharging. Fix the check introduced by commit b0525b48 so that time_to_empty_now is reported correctly during discharge and as zero while charging. Signed-off-by: Sven Neumann Acked-by: Daniel Mack Signed-off-by: Anton Vorontsov Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed