summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-23 11:58:59 -0700
committerMarcel Holtmann <marcel@holtmann.org>2021-03-25 16:09:48 +0100
commitd68903da4e220d1e6b7c6ecdb853c36144c6acc9 (patch)
tree7d3696401372f970092e390829f70f1f73337851 /drivers/bluetooth/btusb.c
parent0a460d8fe2db6887169a19b048ea0c90f8bdc3b7 (diff)
downloadlinux-stable-d68903da4e220d1e6b7c6ecdb853c36144c6acc9.tar.gz
linux-stable-d68903da4e220d1e6b7c6ecdb853c36144c6acc9.tar.bz2
linux-stable-d68903da4e220d1e6b7c6ecdb853c36144c6acc9.zip
Bluetooth: btintel: Consolidate intel_version parsing
This moves version checks of intel_version() to btintel_version_info(). Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Tested-by: Tedd Ho-Jeong An <tedd.an@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r--drivers/bluetooth/btusb.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index f163f174185b..2d3498b74296 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2407,12 +2407,6 @@ static int btusb_setup_intel_new_get_fw_name(struct intel_version *ver,
char *fw_name, size_t len,
const char *suffix)
{
- /* The hardware platform number has a fixed value of 0x37 and
- * for now only accept this single value.
- */
- if (ver->hw_platform != 0x37)
- return -EINVAL;
-
switch (ver->hw_variant) {
case 0x0b: /* SfP */
case 0x0c: /* WsP */
@@ -2582,8 +2576,6 @@ static int btusb_intel_download_firmware(struct hci_dev *hdev,
if (!ver || !params)
return -EINVAL;
- btintel_version_info(hdev, ver);
-
/* The firmware variant determines if the device is in bootloader
* mode or is running operational firmware. The value 0x06 identifies
* the bootloader and the value 0x23 identifies the operational
@@ -2776,6 +2768,10 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
return err;
}
+ err = btintel_version_info(hdev, &ver);
+ if (err)
+ return err;
+
err = btusb_intel_download_firmware(hdev, &ver, &params, &boot_param);
if (err)
return err;