]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/brcm80211/brcmsmac/wl_ucode_loader.c
staging: brcm80211: improved checks on incompatible firmware
[~andy/linux] / drivers / staging / brcm80211 / brcmsmac / wl_ucode_loader.c
index 23e10f3dec0d59319c26f68bf924dc1630a41652..c84e6a70e71dda0413f487037f0398a3f1361b0c 100644 (file)
@@ -41,32 +41,38 @@ int wl_ucode_data_init(struct wl_info *wl)
 {
        int rc;
        rc = wl_check_firmwares(wl);
-       if (rc < 0)
-               return rc;
-       wl_ucode_init_buf(wl, (void **)&d11lcn0bsinitvals24,
-                         D11LCN0BSINITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11lcn0initvals24, D11LCN0INITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11lcn1bsinitvals24,
-                         D11LCN1BSINITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11lcn1initvals24, D11LCN1INITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11lcn2bsinitvals24,
-                         D11LCN2BSINITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11lcn2initvals24, D11LCN2INITVALS24);
-       wl_ucode_init_buf(wl, (void **)&d11n0absinitvals16, D11N0ABSINITVALS16);
-       wl_ucode_init_buf(wl, (void **)&d11n0bsinitvals16, D11N0BSINITVALS16);
-       wl_ucode_init_buf(wl, (void **)&d11n0initvals16, D11N0INITVALS16);
-       wl_ucode_init_buf(wl, (void **)&bcm43xx_16_mimo,
-                         D11UCODE_OVERSIGHT16_MIMO);
-       wl_ucode_init_uint(wl, &bcm43xx_16_mimosz, D11UCODE_OVERSIGHT16_MIMOSZ);
-       wl_ucode_init_buf(wl, (void **)&bcm43xx_24_lcn,
-                         D11UCODE_OVERSIGHT24_LCN);
-       wl_ucode_init_uint(wl, &bcm43xx_24_lcnsz, D11UCODE_OVERSIGHT24_LCNSZ);
-       wl_ucode_init_buf(wl, (void **)&bcm43xx_bommajor,
-                         D11UCODE_OVERSIGHT_BOMMAJOR);
-       wl_ucode_init_buf(wl, (void **)&bcm43xx_bomminor,
-                         D11UCODE_OVERSIGHT_BOMMINOR);
 
-       return 0;
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn0bsinitvals24,
+                                            D11LCN0BSINITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn0initvals24,
+                                            D11LCN0INITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn1bsinitvals24,
+                                            D11LCN1BSINITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn1initvals24,
+                                            D11LCN1INITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn2bsinitvals24,
+                                            D11LCN2BSINITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11lcn2initvals24,
+                                            D11LCN2INITVALS24);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11n0absinitvals16,
+                                            D11N0ABSINITVALS16);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11n0bsinitvals16,
+                                            D11N0BSINITVALS16);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&d11n0initvals16,
+                                            D11N0INITVALS16);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&bcm43xx_16_mimo,
+                                            D11UCODE_OVERSIGHT16_MIMO);
+       rc = rc < 0 ? rc : wl_ucode_init_uint(wl, &bcm43xx_16_mimosz,
+                                             D11UCODE_OVERSIGHT16_MIMOSZ);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&bcm43xx_24_lcn,
+                                            D11UCODE_OVERSIGHT24_LCN);
+       rc = rc < 0 ? rc : wl_ucode_init_uint(wl, &bcm43xx_24_lcnsz,
+                                             D11UCODE_OVERSIGHT24_LCNSZ);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&bcm43xx_bommajor,
+                                            D11UCODE_OVERSIGHT_BOMMAJOR);
+       rc = rc < 0 ? rc : wl_ucode_init_buf(wl, (void **)&bcm43xx_bomminor,
+                                            D11UCODE_OVERSIGHT_BOMMINOR);
+       return rc;
 }
 
 void wl_ucode_data_free(void)