Commit abed84a0 authored by Larry Finger's avatar Larry Finger Committed by Marcel Holtmann

Bluetooth: btrtl: Change message for missing config file

The message concerning missing config files for 8723b, 8821a, and
8761a should have been issued with BT_INFO() rather than BT_ERR() as
this condition is not fatal. After looking at that code, I have
reworked the logic to log such messages only if the device needs such a
config file. At the moment, only the 8822b fits that description.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: default avatar陆朱伟 <alex_lu@realsil.com.cn>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 1eef1c35
...@@ -275,11 +275,8 @@ static int rtl_load_config(struct hci_dev *hdev, const char *name, u8 **buff) ...@@ -275,11 +275,8 @@ static int rtl_load_config(struct hci_dev *hdev, const char *name, u8 **buff)
BT_INFO("%s: rtl: loading %s", hdev->name, name); BT_INFO("%s: rtl: loading %s", hdev->name, name);
ret = request_firmware(&fw, name, &hdev->dev); ret = request_firmware(&fw, name, &hdev->dev);
if (ret < 0) { if (ret < 0)
BT_ERR("%s: Failed to load %s", hdev->name, name);
return ret; return ret;
}
ret = fw->size; ret = fw->size;
*buff = kmemdup(fw->data, ret, GFP_KERNEL); *buff = kmemdup(fw->data, ret, GFP_KERNEL);
...@@ -331,6 +328,7 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver, ...@@ -331,6 +328,7 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver,
u8 *cfg_buff = NULL; u8 *cfg_buff = NULL;
u8 *tbuff; u8 *tbuff;
char *cfg_name = NULL; char *cfg_name = NULL;
bool config_needed = false;
switch (lmp_subver) { switch (lmp_subver) {
case RTL_ROM_LMP_8723B: case RTL_ROM_LMP_8723B:
...@@ -344,6 +342,7 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver, ...@@ -344,6 +342,7 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver,
break; break;
case RTL_ROM_LMP_8822B: case RTL_ROM_LMP_8822B:
cfg_name = "rtl_bt/rtl8822b_config.bin"; cfg_name = "rtl_bt/rtl8822b_config.bin";
config_needed = true;
break; break;
default: default:
BT_ERR("%s: rtl: no config according to lmp_subver %04x", BT_ERR("%s: rtl: no config according to lmp_subver %04x",
...@@ -353,8 +352,12 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver, ...@@ -353,8 +352,12 @@ static int btrtl_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver,
if (cfg_name) { if (cfg_name) {
cfg_sz = rtl_load_config(hdev, cfg_name, &cfg_buff); cfg_sz = rtl_load_config(hdev, cfg_name, &cfg_buff);
if (cfg_sz < 0) if (cfg_sz < 0) {
cfg_sz = 0; cfg_sz = 0;
if (config_needed)
BT_ERR("Necessary config file %s not found\n",
cfg_name);
}
} else } else
cfg_sz = 0; cfg_sz = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment