summaryrefslogtreecommitdiff
path: root/drivers/power/supply/axp288_charger.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-05-23 16:33:21 +0300
committerSebastian Reichel <sre@kernel.org>2018-07-06 18:19:37 +0300
commitf2a42595f0865886a2d40524b0e9d15600848670 (patch)
treea46b023ff460024fec9058555d64377d67e05271 /drivers/power/supply/axp288_charger.c
parentada1de89f34ea338fb4406e61dc1a95edcf65213 (diff)
downloadlinux-f2a42595f0865886a2d40524b0e9d15600848670.tar.xz
power: supply: axp288_charger: Fix initial constant_charge_current value
We should look at val which contains the value read from the register, not ret which is always 0 on a successful read. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Fixes: eac53b3664f59 ("power: supply: axp288_charger: Drop platform_data dependency") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power/supply/axp288_charger.c')
-rw-r--r--drivers/power/supply/axp288_charger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
index 6e1bc14c3304..735658ee1c60 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -718,7 +718,7 @@ static int charger_init_hw_regs(struct axp288_chrg_info *info)
}
/* Determine charge current limit */
- cc = (ret & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS;
+ cc = (val & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS;
cc = (cc * CHRG_CCCV_CC_LSB_RES) + CHRG_CCCV_CC_OFFSET;
info->cc = cc;