Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 86af9503 authored by Sven Neumann's avatar Sven Neumann Committed by Anton Vorontsov
Browse files

ds2760_battery: Fix calculation of time_to_empty_now



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: default avatarSven Neumann <s.neumann@raumfeld.com>
Acked-by: default avatarDaniel Mack <daniel@caiaq.de>
Cc: stable@kernel.org [2.6.32..2.6.36]
Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
parent e53beacd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment