Skip to content

Commit eae5bb7

Browse files
moore-brosgregkh
authored andcommitted
Bluetooth: btmtk: apply the common btmtk_fw_get_filename
[ Upstream commit 7f935b2 ] Apply the common btmtk_fw_get_filename to avoid the similar coding in each driver. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Stable-dep-of: 5c5e8c5 ("Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1fa22de commit eae5bb7

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/bluetooth/btmtksdio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,9 @@ static int btmtksdio_setup(struct hci_dev *hdev)
11111111
return err;
11121112
}
11131113

1114+
btmtk_fw_get_filename(fwname, sizeof(fwname), dev_id,
1115+
fw_version, 0);
1116+
11141117
snprintf(fwname, sizeof(fwname),
11151118
"mediatek/BT_RAM_CODE_MT%04x_1_%x_hdr.bin",
11161119
dev_id & 0xffff, (fw_version & 0xff) + 1);

drivers/bluetooth/btusb.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2940,14 +2940,8 @@ static int btusb_mtk_setup(struct hci_dev *hdev)
29402940
case 0x7922:
29412941
case 0x7961:
29422942
case 0x7925:
2943-
if (dev_id == 0x7925)
2944-
snprintf(fw_bin_name, sizeof(fw_bin_name),
2945-
"mediatek/mt%04x/BT_RAM_CODE_MT%04x_1_%x_hdr.bin",
2946-
dev_id & 0xffff, dev_id & 0xffff, (fw_version & 0xff) + 1);
2947-
else
2948-
snprintf(fw_bin_name, sizeof(fw_bin_name),
2949-
"mediatek/BT_RAM_CODE_MT%04x_1_%x_hdr.bin",
2950-
dev_id & 0xffff, (fw_version & 0xff) + 1);
2943+
btmtk_fw_get_filename(fw_bin_name, sizeof(fw_bin_name), dev_id,
2944+
fw_version, 0);
29512945

29522946
err = btmtk_setup_firmware_79xx(hdev, fw_bin_name,
29532947
btmtk_usb_hci_wmt_sync);

0 commit comments

Comments
 (0)