Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09edcb64 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Sebastian Reichel
Browse files

power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()'



If an error occurs when we enable the backup battery charging, we should
go through the error handling path directly.

Before commit db43e6c4 ("ab8500-bm: Add usb power path support") this
was the case, but this commit has added some code between the last test and
the 'out' label.
So, in case of error, this added code is executed and the error may be
silently ignored.

Fix it by adding the missing 'goto out', as done in all other error
handling paths.

Fixes: db43e6c4 ("ab8500-bm: Add usb power path support")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent bf59fddd
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -3221,8 +3221,10 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
	ret = abx500_mask_and_set_register_interruptible(di->dev,
	ret = abx500_mask_and_set_register_interruptible(di->dev,
		AB8500_RTC, AB8500_RTC_CTRL_REG,
		AB8500_RTC, AB8500_RTC_CTRL_REG,
		RTC_BUP_CH_ENA, RTC_BUP_CH_ENA);
		RTC_BUP_CH_ENA, RTC_BUP_CH_ENA);
	if (ret < 0)
	if (ret < 0) {
		dev_err(di->dev, "%s mask and set failed\n", __func__);
		dev_err(di->dev, "%s mask and set failed\n", __func__);
		goto out;
	}


	if (is_ab8540(di->parent)) {
	if (is_ab8540(di->parent)) {
		ret = abx500_mask_and_set_register_interruptible(di->dev,
		ret = abx500_mask_and_set_register_interruptible(di->dev,