Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: qca: simplify WCN399x NVM loading

The WCN399x code has two separate cases for loading the NVM data. In
preparation to adding support for WCN3950, which also requires similar
quirk, split the "variant" to be specified explicitly and merge two
snprintfs into a single one.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Dmitry Baryshkov and committed by
Luiz Augusto von Dentz
1cc41b50 d0b391ef

+6 -7
+6 -7
drivers/bluetooth/btqca.c
··· 785 785 const char *firmware_name, const char *rampatch_name) 786 786 { 787 787 struct qca_fw_config config = {}; 788 + const char *variant = ""; 788 789 int err; 789 790 u8 rom_ver = 0; 790 791 u32 soc_ver; ··· 884 883 case QCA_WCN3990: 885 884 case QCA_WCN3991: 886 885 case QCA_WCN3998: 887 - if (le32_to_cpu(ver.soc_id) == QCA_WCN3991_SOC_ID) { 888 - snprintf(config.fwname, sizeof(config.fwname), 889 - "qca/crnv%02xu.bin", rom_ver); 890 - } else { 891 - snprintf(config.fwname, sizeof(config.fwname), 892 - "qca/crnv%02x.bin", rom_ver); 893 - } 886 + if (le32_to_cpu(ver.soc_id) == QCA_WCN3991_SOC_ID) 887 + variant = "u"; 888 + 889 + snprintf(config.fwname, sizeof(config.fwname), 890 + "qca/crnv%02x%s.bin", rom_ver, variant); 894 891 break; 895 892 case QCA_WCN3988: 896 893 snprintf(config.fwname, sizeof(config.fwname),