power: supply: axp288_charger: Fix initial constant_charge_current value
authorHans de Goede <hdegoede@redhat.com>
Wed, 23 May 2018 13:33:21 +0000 (15:33 +0200)
committerSebastian Reichel <sre@kernel.org>
Fri, 6 Jul 2018 15:19:37 +0000 (17:19 +0200)
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>
drivers/power/supply/axp288_charger.c

index 6e1bc14..735658e 100644 (file)
@@ -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;