Skip to content

Commit

Permalink
power: supply: ab8500_charger: Fix an error handling path
Browse files Browse the repository at this point in the history
[ Upstream commit bf59fdd ]

'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: 84edbee ("ab8500-charger: AB8500 charger driver")
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tititiou36 authored and gregkh committed Mar 19, 2018
1 parent 7579eda commit 487d435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 487d435

Please sign in to comment.