2.6.36-stable review patch. If anyone has any objections, please let us know.
------------------ From: Sven Neumann <[email protected]> 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 <[email protected]> Acked-by: Daniel Mack <[email protected]> Signed-off-by: Anton Vorontsov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> --- drivers/power/ds2760_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/power/ds2760_battery.c +++ b/drivers/power/ds2760_battery.c @@ -212,7 +212,7 @@ static int ds2760_battery_read_status(st if (di->rem_capacity > 100) di->rem_capacity = 100; - if (di->current_uA >= 100L) + if (di->current_uA < -100L) di->life_sec = -((di->accum_current_uAh - di->empty_uAh) * 36L) / (di->current_uA / 100L); else _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
