Bluetooth: Perform check for BR/EDR support in a common place
Both of the br_init() functions should be checking for BR/EDR support before issuing the commands. To not have to code the check twice, do it in hci_init() before calling br_init(). Change-Id: I2de3aa3c2e85322257b27b1c716b37c326d5bae7 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
5b58da915e
commit
70742bdda8
1 changed files with 7 additions and 8 deletions
|
@ -1655,11 +1655,6 @@ static int br_init(void)
|
|||
struct net_buf *rsp;
|
||||
int err;
|
||||
|
||||
if (!lmp_bredr_capable(bt_dev)) {
|
||||
BT_DBG("Non-BR/EDR controller detected! Skipping BR init.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bt_dev.le.mtu) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1726,9 +1721,13 @@ static int hci_init(void)
|
|||
return err;
|
||||
}
|
||||
|
||||
err = br_init();
|
||||
if (err) {
|
||||
return err;
|
||||
if (lmp_bredr_capable(bt_dev)) {
|
||||
err = br_init();
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
} else {
|
||||
BT_DBG("Non-BR/EDR controller detected! Skipping BR init.\n");
|
||||
}
|
||||
|
||||
err = set_event_mask();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue