Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8680f12 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org
parent 21a60d30
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1100,9 +1100,7 @@ static int clean_up_hci_state(struct hci_dev *hdev)
	if (test_bit(HCI_ADVERTISING, &hdev->dev_flags))
		disable_advertising(&req);

	if (test_bit(HCI_LE_SCAN, &hdev->dev_flags)) {
		hci_req_add_le_scan_disable(&req);
	}
	hci_stop_discovery(&req);

	list_for_each_entry(conn, &hdev->conn_hash.list, list) {
		struct hci_cp_disconnect dc;