diff mbox series

[v2] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()

Message ID 1669959342-27144-1-git-send-email-wangyufen@huawei.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [v2] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

wangyufen Dec. 2, 2022, 5:35 a.m. UTC
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>
---
v2: change the error code from EINVAL to EIO, as Arend suggessted

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Arend van Spriel Dec. 2, 2022, 7:13 p.m. UTC | #1
On 12/2/2022 6:35 AM, Wang Yufen wrote:
> 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")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
> v2: change the error code from EINVAL to EIO, as Arend suggessted

Thanks.

>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 +
>   2 files changed, 2 insertions(+), 1 deletion(-)
Kalle Valo Dec. 8, 2022, 2:47 p.m. UTC | #2
Wang Yufen <wangyufen@huawei.com> wrote:

> 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>

Patch applied to wireless-next.git, thanks.

c2f2924bc7f9 wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 80083f9..aaf8e12 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -726,7 +726,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;
 }
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 465d95d..e265a2e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -3414,6 +3414,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;
 	}