]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ath10k: snoc: fix unabalanced regulator error handling
authorBrian Norris <briannorris@chromium.org>
Mon, 5 Nov 2018 12:34:57 +0000 (14:34 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Nov 2018 16:16:56 +0000 (18:16 +0200)
commit1a1a0d5ccefca6f3f7417b448793c753a610da0c
treee296cdf745c8de022b2c7daf92e2faa0ed792b72
parent887a3dcf589389756bad51b34b69d4e9e9b2aa86
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.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/snoc.c