brcmfmac: use chipname in brcmf_fw_alloc_request() for error path as well
authorArend van Spriel <arend.vanspriel@broadcom.com>
Thu, 14 Feb 2019 12:43:52 +0000 (13:43 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 19 Feb 2019 15:04:59 +0000 (17:04 +0200)
The local variable chipname is string representation of chip id and revision
which is printed in the good flow of brcmf_fw_alloc_request(). Also use it
for the error path, ie. for unknown/unsupported devices.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c

index cf1ddf98847678d6fb467f2ca152cb57c822016c..8209a42dea72c021f18338cad2f92574bc176b81 100644 (file)
@@ -719,8 +719,10 @@ brcmf_fw_alloc_request(u32 chip, u32 chiprev,
                        break;
        }
 
+       brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
+
        if (i == table_size) {
-               brcmf_err("Unknown chipid %d [%d]\n", chip, chiprev);
+               brcmf_err("Unknown chip %s\n", chipname);
                return NULL;
        }
 
@@ -729,8 +731,6 @@ brcmf_fw_alloc_request(u32 chip, u32 chiprev,
        if (!fwreq)
                return NULL;
 
-       brcmf_chip_name(chip, chiprev, chipname, sizeof(chipname));
-
        brcmf_info("using %s for chip %s\n",
                   mapping_table[i].fw_base, chipname);