From 47cb69458aca536fcf48cfabc52d68fcdf7bd4fb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 8 Jul 2015 11:01:50 +0300 Subject: [PATCH] Bluetooth: Remove unnecessary 'err' variable from bt_connect_le() Instead of caring about stop_scanning() failure it's better to have bt_connect_le() do "best effort" and simply try to continue in this case. Change-Id: I14896a4dfbe0bfd2564a190080743f0c9b05d174 Signed-off-by: Johan Hedberg --- net/bluetooth/hci_core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 290c3a6b694..c7a6b4ca134 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -1536,7 +1536,6 @@ int bt_hci_le_conn_update(uint16_t handle, uint16_t min, uint16_t max, struct bt_conn *bt_connect_le(const bt_addr_le_t *peer) { struct bt_conn *conn; - int err = 0; conn = bt_conn_lookup_addr_le(peer); if (conn) { @@ -1560,12 +1559,10 @@ struct bt_conn *bt_connect_le(const bt_addr_le_t *peer) /* Restart scanning if duplicate filtering feature is used */ if (dev.scan_enable && dev.scan_filter) { - err = bt_hci_stop_scanning(); + bt_hci_stop_scanning(); } - if (!err) { - trigger_scan(); - } + trigger_scan(); return conn; }