aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index cc60465ea774..5dcacf9607e4 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2634,6 +2634,12 @@ static int hci_dev_do_close(struct hci_dev *hdev)
2634 drain_workqueue(hdev->workqueue); 2634 drain_workqueue(hdev->workqueue);
2635 2635
2636 hci_dev_lock(hdev); 2636 hci_dev_lock(hdev);
2637
2638 if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
2639 if (hdev->dev_type == HCI_BREDR)
2640 mgmt_powered(hdev, 0);
2641 }
2642
2637 hci_inquiry_cache_flush(hdev); 2643 hci_inquiry_cache_flush(hdev);
2638 hci_pend_le_actions_clear(hdev); 2644 hci_pend_le_actions_clear(hdev);
2639 hci_conn_hash_flush(hdev); 2645 hci_conn_hash_flush(hdev);
@@ -2681,14 +2687,6 @@ static int hci_dev_do_close(struct hci_dev *hdev)
2681 hdev->flags &= BIT(HCI_RAW); 2687 hdev->flags &= BIT(HCI_RAW);
2682 hdev->dev_flags &= ~HCI_PERSISTENT_MASK; 2688 hdev->dev_flags &= ~HCI_PERSISTENT_MASK;
2683 2689
2684 if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
2685 if (hdev->dev_type == HCI_BREDR) {
2686 hci_dev_lock(hdev);
2687 mgmt_powered(hdev, 0);
2688 hci_dev_unlock(hdev);
2689 }
2690 }
2691
2692 /* Controller radio is available but is currently powered down */ 2690 /* Controller radio is available but is currently powered down */
2693 hdev->amp_status = AMP_STATUS_POWERED_DOWN; 2691 hdev->amp_status = AMP_STATUS_POWERED_DOWN;
2694 2692