UPSTREAM: ath10k: snoc: fix unabalanced regulator error handling
If a regulator fails to set its voltage, we end up with an unbalanced call to regulator_disable(), because the error path starts with the current regulator (which was never enabled). Factor out the "on" function to perform (and unwind if failed) a single regulator at a time, and then main loop (ath10k_snoc_vreg_on()) can just worry about unwinding the regulators that were already enabled. It also helps to factor out the "off" function, to avoid repeating some code here. BUG=b:137525452 TEST=None Signed-off-by:Brian Norris <briannorris@chromium.org> Reviewed-by:
Douglas Anderson <dianders@chromium.org> Signed-off-by:
Kalle Valo <kvalo@codeaurora.org> Signed-off-by:
Govind Singh <govinds@codeaurora.org> (Cherry picked from commit 1a1a0d5c) (Source: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ) Change-Id: Ib1158919ebabe3da14e24a76598116fb87bac2f8 Signed-off-by:
Vamsi Singamsetty <vamssi@codeaurora.org>
Loading
Please sign in to comment