[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BYAPR20MB24723A54E913F0218DF87F83BCF79@BYAPR20MB2472.namprd20.prod.outlook.com>
Date: Sat, 23 Apr 2022 00:02:29 +0800
From: icenowy@...look.com
To: Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc: linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-sunxi@...ts.linux.dev, Icenowy Zheng <icenowy@...eed.com>
Subject: [PATCH 1/3] Bluetooth: btrtl: try config w/o postfix if postfixed one failed to load
From: Icenowy Zheng <icenowy@...eed.com>
We should try the non-prefixed config file name if the prefixed one
failed to load (possibly because of it does not exist).
Add this behavior to firmware-loading routine.
Signed-off-by: Icenowy Zheng <icenowy@...eed.com>
---
drivers/bluetooth/btrtl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 481d488bca0f..1f834513762b 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -699,6 +699,12 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
}
btrtl_dev->cfg_len = rtl_load_file(hdev, cfg_name,
&btrtl_dev->cfg_data);
+ if (postfix && btrtl_dev->cfg_len <= 0) {
+ snprintf(cfg_name, sizeof(cfg_name), "%s.bin",
+ btrtl_dev->ic_info->cfg_name);
+ btrtl_dev->cfg_len = rtl_load_file(hdev, cfg_name,
+ &btrtl_dev->cfg_data);
+ }
if (btrtl_dev->ic_info->config_needed &&
btrtl_dev->cfg_len <= 0) {
rtl_dev_err(hdev, "mandatory config file %s not found",
--
2.35.1
Powered by blists - more mailing lists