]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
charger-manager: Fix bug when check dropped voltage after fullbatt event
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 22 Nov 2012 07:53:51 +0000 (16:53 +0900)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Mon, 17 Dec 2012 06:45:58 +0000 (22:45 -0800)
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 <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/charger-manager.c

index 633e41ca49ac55386d46114af828c8085ea74139..6ba047f5ac2c35d413773368cd39f3d6bb14ae1f 100644 (file)
@@ -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);