summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-07 00:58:33 -0700
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-07 10:08:39 +0200
commit93c311a044442db62717ae509e09047f34dc3583 (patch)
tree2a58dedc91a316fe99232585d874115171c1f7c0 /net/bluetooth/hci_core.c
parent004b02589c5394a75660a00829086460cc3e4366 (diff)
downloadlinux-93c311a044442db62717ae509e09047f34dc3583.tar.bz2
Bluetooth: Make mgmt power down notification for BR/EDR explicit
The management interface only operates on BR/EDR controllers. The check for the power down notification is a bit intermixed with the check if controller auto power off is active. Since there are more than just BR/EDR controllers supported, make this check explicit since the auto power off check also applies to AMP controllers and it has to happen in this exact order. Otherwise the bit will not be cleared. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2ee5a8ee75c5..3572611c0297 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1393,11 +1393,12 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hdev->flags = 0;
hdev->dev_flags &= ~HCI_PERSISTENT_MASK;
- if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags) &&
- hdev->dev_type == HCI_BREDR) {
- hci_dev_lock(hdev);
- mgmt_powered(hdev, 0);
- hci_dev_unlock(hdev);
+ if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
+ if (hdev->dev_type == HCI_BREDR) {
+ hci_dev_lock(hdev);
+ mgmt_powered(hdev, 0);
+ hci_dev_unlock(hdev);
+ }
}
/* Controller radio is available but is currently powered down */