From: Johan Hedberg Date: Tue, 21 Feb 2012 15:15:41 +0000 (+0200) Subject: Bluetooth: mgmt: Fix current settings values when powered off X-Git-Tag: v3.4-rc1~177^2~112^2~96 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f1f0eb02213a3003ecb10b9c61694e588267b824;p=karo-tx-linux.git 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 Acked-by: Marcel Holtmann --- 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) { 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))