]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Bluetooth: mgmt: Fix current settings values when powered off
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 21 Feb 2012 15:15:41 +0000 (17:15 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 21 Feb 2012 18:04:39 +0000 (20:04 +0200)
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>
net/bluetooth/mgmt.c

index eec70a4ba36cd4d84a6975bcb25967ad8958f499..86e63a707f5a7269e5d065697a2415b88d9b4031 100644 (file)
@@ -392,10 +392,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
 {
        u32 settings = 0;
 
-       if (!test_bit(HCI_UP, &hdev->flags))
-               return settings;
-
-       if (!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
+       if (hdev_is_powered(hdev))
                settings |= MGMT_SETTING_POWERED;
 
        if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))