summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-09-02 15:31:17 +0200
committerSebastian Reichel <sre@kernel.org>2020-10-09 00:33:09 +0200
commit10a4357f4aebb30d20fe5f0297930b292862fed9 (patch)
tree2d33b963a912b9a119c0ef98fad949e65db4b92f /drivers/power
parentpower: supply: max17040: Fix ptr to enum cast (diff)
downloadlinux-10a4357f4aebb30d20fe5f0297930b292862fed9.tar.xz
linux-10a4357f4aebb30d20fe5f0297930b292862fed9.zip
power: supply: charger-manager: fix incorrect check on charging_duration_ms
Currently the duration check on the discharging duration setting is checking the charging duration rather than the discharging duration due to a cut-n-paste coding error. Fix this by checking the value desc->charging_max_duration_ms. Addresses-Coverity: ("Copy-paste-error") Fixes: 8fcfe088e21a ("charger-manager: Support limit of maximum possible") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/charger-manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index b2ca79173f95..6fcebe441552 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -471,7 +471,7 @@ static int check_charging_duration(struct charger_manager *cm)
} else if (cm->battery_status == POWER_SUPPLY_STATUS_NOT_CHARGING) {
duration = curr - cm->charging_end_time;
- if (duration > desc->charging_max_duration_ms) {
+ if (duration > desc->discharging_max_duration_ms) {
dev_info(cm->dev, "Discharging duration exceed %ums\n",
desc->discharging_max_duration_ms);
ret = true;