wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
authorWang Yufen <wangyufen@huawei.com>
Fri, 2 Dec 2022 05:35:42 +0000 (13:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:18 +0000 (13:14 +0100)
[ Upstream commit c2f2924bc7f9ea75ef8d95863e710168f8196256 ]

Fix to return a negative error code instead of 0 when
brcmf_chip_set_active() fails. In addition, change the return
value for brcmf_pcie_exit_download_state() to keep consistent.

Fixes: d380ebc9b6fb ("brcmfmac: rename chip download functions")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/1669959342-27144-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

index 3ff4997e1c97a3a7396f60ee58899de9413528b2..358021a33b8a308dafb304bc7a1f16ecfac0a031 100644 (file)
@@ -626,7 +626,7 @@ static int brcmf_pcie_exit_download_state(struct brcmf_pciedev_info *devinfo,
        }
 
        if (!brcmf_chip_set_active(devinfo->ci, resetintr))
-               return -EINVAL;
+               return -EIO;
        return 0;
 }
 
index f7961b22e0518145b54be0299614d402fdf4cdf9..5006aa8317513117ad77c460da0126c9a0f0a3a6 100644 (file)
@@ -3411,6 +3411,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus,
        /* Take arm out of reset */
        if (!brcmf_chip_set_active(bus->ci, rstvec)) {
                brcmf_err("error getting out of ARM core reset\n");
+               bcmerror = -EIO;
                goto err;
        }