From f36b9ddbab408f5f5ed9105d857189b84337af48 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 22 Nov 2012 16:53:51 +0900 Subject: charger-manager: Fix bug when check dropped voltage after fullbatt event This patch check difference value between current voltage of battery and desc->fullbatt_uV whether positve or negative number. If difference value is negative number when current voltage of battery is larger than desc->fullbatt_uV, charger-manager return immediately because battery is fully charged. Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham Signed-off-by: Kyungmin Park Signed-off-by: Anton Vorontsov --- drivers/power/charger-manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/power/charger-manager.c') diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index 633e41ca49ac..6ba047f5ac2c 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c @@ -482,8 +482,9 @@ static void fullbatt_vchk(struct work_struct *work) return; } - diff = desc->fullbatt_uV; - diff -= batt_uV; + diff = desc->fullbatt_uV - batt_uV; + if (diff < 0) + return; dev_info(cm->dev, "VBATT dropped %duV after full-batt.\n", diff); -- cgit v1.2.3