Bluetooth: Add missing QUIRK_NO_RESET test to hci_dev_do_close
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 3 Feb 2012 19:29:40 +0000 (21:29 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:34 +0000 (17:01 +0200)
We should only perform a reset in hci_dev_do_close if the
HCI_QUIRK_NO_RESET flag is set (since in such a case a reset will not be
performed when initializing the device).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_core.c

index 95eeae59812de98f350ea355bd5469fa8dcc6972..8bffd3eb344d3271d4b2527de07824ca6b61a61d 100644 (file)
@@ -767,7 +767,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
        /* Reset device */
        skb_queue_purge(&hdev->cmd_q);
        atomic_set(&hdev->cmd_cnt, 1);
-       if (!test_bit(HCI_RAW, &hdev->flags)) {
+       if (!test_bit(HCI_RAW, &hdev->flags) &&
+                               test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) {
                set_bit(HCI_INIT, &hdev->flags);
                __hci_request(hdev, hci_reset_req, 0,
                                        msecs_to_jiffies(250));