brcmfmac: Remove recursion from firmware load error handling
authorHans de Goede <hdegoede@redhat.com>
Wed, 10 Oct 2018 11:00:59 +0000 (13:00 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Nov 2018 16:50:14 +0000 (18:50 +0200)
commit5b587496dc63595b71265d986ce69728c2724370
tree95eedc8752d9d8d4dae3782be08dd27a36d47adb
parenta1a3b762163868ad07a4499a73df324f40d5ab0b
brcmfmac: Remove recursion from firmware load error handling

Before this commit brcmf_fw_request_done would call
brcmf_fw_request_next_item to load the next item, which on an error would
call brcmf_fw_request_done, which if the error is recoverable (*) will
then continue calling brcmf_fw_request_next_item for the next item again
which on an error will call brcmf_fw_request_done again...

This does not blow up because we only have a limited number of items so
we never recurse too deep. But the recursion is still quite ugly and
frankly is giving me a headache, so lets fix this.

This commit fixes this by removing brcmf_fw_request_next_item and by
making brcmf_fw_get_firmwares and brcmf_fw_request_done directly call
firmware_request_nowait resp. firmware_request themselves.

*) brcmf_fw_request_nvram_done fallback path succeeds or
   BRCMF_FW_REQF_OPTIONAL is set

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c