brcm80211: fix error code in brcmf_pcie_exit_download_state()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 27 Nov 2015 13:43:27 +0000 (16:43 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 30 Nov 2015 12:58:59 +0000 (14:58 +0200)
The original code returns 1 on failure and 0 on success but the caller
was expecting an error code on failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c

index ace0404817dc8369ad53fa5103747342139def0e..b5a4247604f33f74d8b4a269b7de64f817b9590d 100644 (file)
@@ -609,7 +609,9 @@ static int brcmf_pcie_exit_download_state(struct brcmf_pciedev_info *devinfo,
                brcmf_chip_resetcore(core, 0, 0, 0);
        }
 
-       return !brcmf_chip_set_active(devinfo->ci, resetintr);
+       if (!brcmf_chip_set_active(devinfo->ci, resetintr))
+               return -EINVAL;
+       return 0;
 }