]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
power: supply: ab8500_charger: Fix an error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 22 Nov 2017 20:27:31 +0000 (21:27 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Fri, 1 Dec 2017 15:21:18 +0000 (16:21 +0100)
'ret' is know to be 0 at this point, because it has not been updated by the
the previous call to 'abx500_mask_and_set_register_interruptible()'.

Fix it by updating 'ret' before checking if an error occurred.

Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/ab8500_charger.c

index 4ebbcce45c48407a69ae10d177a786d7f7d52ec7..1cdbe7a0738db54ebb4f283500ebaa99e2ee584c 100644 (file)
@@ -3218,7 +3218,7 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
        }
 
        /* Enable backup battery charging */
-       abx500_mask_and_set_register_interruptible(di->dev,
+       ret = abx500_mask_and_set_register_interruptible(di->dev,
                AB8500_RTC, AB8500_RTC_CTRL_REG,
                RTC_BUP_CH_ENA, RTC_BUP_CH_ENA);
        if (ret < 0)