power: supply: charger-manager: Fix typo in condition
authorRyosuke Saito <raitosyo@gmail.com>
Tue, 21 Nov 2017 04:27:12 +0000 (13:27 +0900)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Fri, 1 Dec 2017 15:14:06 +0000 (16:14 +0100)
Should be discharging_max_duration_ms, not charging_max_duration_ms.

Signed-off-by: Ryosuke Saito <raitosyo@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/charger-manager.c

index 6502fa7..1de4b44 100644 (file)
@@ -578,7 +578,7 @@ static int check_charging_duration(struct charger_manager *cm)
        } else if (is_ext_pwr_online(cm) && !cm->charger_enabled) {
                duration = curr - cm->charging_end_time;
 
-               if (duration > desc->charging_max_duration_ms &&
+               if (duration > desc->discharging_max_duration_ms &&
                                is_ext_pwr_online(cm)) {
                        dev_info(cm->dev, "Discharging duration exceed %ums\n",
                                 desc->discharging_max_duration_ms);