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

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: btqca: move WCN7850 workaround to the caller

WCN7850 will first attempt to use ELF_TYPE_PATCH,
and if that fails, it will fall back to TLV_TYPE_PATCH.

To code uniformity, move WCN7850 workaround to the caller.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Shuai Zhang and committed by
Luiz Augusto von Dentz
ff3bb47a 132c0779

+17 -20
+17 -20
drivers/bluetooth/btqca.c
··· 581 581 582 582 ret = request_firmware(&fw, config->fwname, &hdev->dev); 583 583 if (ret) { 584 - /* For WCN6750, if mbn file is not present then check for 585 - * tlv file. 586 - */ 587 - if (soc_type == QCA_WCN6750 && config->type == ELF_TYPE_PATCH) { 588 - bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)", 589 - config->fwname, ret); 590 - config->type = TLV_TYPE_PATCH; 591 - snprintf(config->fwname, sizeof(config->fwname), 592 - "qca/msbtfw%02x.tlv", rom_ver); 593 - bt_dev_info(hdev, "QCA Downloading %s", config->fwname); 594 - ret = request_firmware(&fw, config->fwname, &hdev->dev); 595 - if (ret) { 596 - bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", 597 - config->fwname, ret); 598 - return ret; 599 - } 600 - } 601 584 /* If the board-specific file is missing, try loading the default 602 585 * one, unless that was attempted already. 603 586 */ 604 - else if (config->type == TLV_TYPE_NVM && 605 - qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) { 587 + if (config->type == TLV_TYPE_NVM && 588 + qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) { 606 589 bt_dev_info(hdev, "QCA Downloading %s", config->fwname); 607 590 ret = request_firmware(&fw, config->fwname, &hdev->dev); 608 591 if (ret) { ··· 844 861 } 845 862 846 863 err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 864 + /* For WCN6750, if mbn file is not present then check for 865 + * tlv file. 866 + */ 867 + if (err < 0 && soc_type == QCA_WCN6750) { 868 + bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)", 869 + config.fwname, err); 870 + config.type = TLV_TYPE_PATCH; 871 + snprintf(config.fwname, sizeof(config.fwname), 872 + "qca/msbtfw%02x.tlv", rom_ver); 873 + bt_dev_info(hdev, "QCA Downloading %s", config.fwname); 874 + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); 875 + } 876 + 847 877 if (err < 0) { 848 - bt_dev_err(hdev, "QCA Failed to download patch (%d)", err); 878 + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", 879 + config.fwname, err); 849 880 return err; 850 881 } 851 882