aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-21 10:15:41 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-21 13:04:39 -0500
commitf1f0eb02213a3003ecb10b9c61694e588267b824 (patch)
treebecece4750f4c38b314d45a905a5739e6bb11397 /net/bluetooth/mgmt.c
parentdf2c6c5ed5c0bc13b78e855d3e5d9aa3472567ba (diff)
Bluetooth: mgmt: Fix current settings values when powered off
We should not stop iterating through the various settings if powered off since most may still be set even then. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index eec70a4ba36c..86e63a707f5a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -392,10 +392,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
392{ 392{
393 u32 settings = 0; 393 u32 settings = 0;
394 394
395 if (!test_bit(HCI_UP, &hdev->flags)) 395 if (hdev_is_powered(hdev))
396 return settings;
397
398 if (!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
399 settings |= MGMT_SETTING_POWERED; 396 settings |= MGMT_SETTING_POWERED;
400 397
401 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags)) 398 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))