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:
Johan Hedberg 2015-11-19 10:45:59 +02:00 committed by Anas Nashif
commit 70742bdda8

View file

@ -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();