power: supply: charger-manager: fix incorrect check on charging_duration_ms
authorColin Ian King <colin.king@canonical.com>
Wed, 2 Sep 2020 13:31:17 +0000 (14:31 +0100)
committerSebastian Reichel <sre@kernel.org>
Thu, 8 Oct 2020 22:33:09 +0000 (00:33 +0200)
commit10a4357f4aebb30d20fe5f0297930b292862fed9
tree2d33b963a912b9a119c0ef98fad949e65db4b92f
parent7f977e64370dad07b01601bb2ba959678a149ff3
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>
drivers/power/supply/charger-manager.c