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

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

power: supply: ab8500_charger: Fix an error handling path



'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: 84edbeea ("ab8500-charger: AB8500 charger driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent f46b151e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3218,7 +3218,7 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
	}
	}


	/* Enable backup battery charging */
	/* 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,
		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)