brcmfmac: do not use firmware error code in driver
authorArend van Spriel <arend@broadcom.com>
Tue, 28 Oct 2014 13:56:09 +0000 (14:56 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 30 Oct 2014 19:24:50 +0000 (15:24 -0400)
Passing the firmware error codes up the driver may be mapped to
linux error numbers which may impact proper fault analysis. So
better pass up a generic failure code, ie. -EBADE and only show
firmware error code in FIL debug message.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/fwil.c

index 42da73e261421852adf86cd17e81475564446e2a..dccbdc1aae6df8b16814d343f5d63ca31ee8a0bb 100644 (file)
@@ -122,12 +122,11 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
                err = brcmf_proto_query_dcmd(drvr, ifp->ifidx, cmd, data, len);
 
        if (err >= 0)
-               err = 0;
-       else
-               brcmf_dbg(FIL, "Failed: %s (%d)\n",
-                         brcmf_fil_get_errstr((u32)(-err)), err);
+               return 0;
 
-       return err;
+       brcmf_dbg(FIL, "Failed: %s (%d)\n",
+                 brcmf_fil_get_errstr((u32)(-err)), err);
+       return -EBADE;
 }
 
 s32