aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-06-10 07:05:59 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-06-13 07:32:23 -0400
commitf8680f128b01212895a9afb31032f6ffe91bd771 (patch)
tree0da8d68e33e84af03f199e4d0d9455628e36b397
parent21a60d307ddc2180cfa542a995d943d1034cf5c5 (diff)
Bluetooth: Reuse hci_stop_discovery function when cleaning up HCI state
When cleaning up the HCI state as part of the power-off procedure we can reuse the hci_stop_discovery() function instead of explicitly sending HCI command related to discovery. The added benefit of this is that it takes care of canceling name resolving and inquiry which were not previously covered by the code. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable@vger.kernel.org
-rw-r--r--net/bluetooth/mgmt.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index be6f03219121..6107e037cd8e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1100,9 +1100,7 @@ static int clean_up_hci_state(struct hci_dev *hdev)
1100 if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) 1100 if (test_bit(HCI_ADVERTISING, &hdev->dev_flags))
1101 disable_advertising(&req); 1101 disable_advertising(&req);
1102 1102
1103 if (test_bit(HCI_LE_SCAN, &hdev->dev_flags)) { 1103 hci_stop_discovery(&req);
1104 hci_req_add_le_scan_disable(&req);
1105 }
1106 1104
1107 list_for_each_entry(conn, &hdev->conn_hash.list, list) { 1105 list_for_each_entry(conn, &hdev->conn_hash.list, list) {
1108 struct hci_cp_disconnect dc; 1106 struct hci_cp_disconnect dc;