Thread (19 messages) flat view 19 messages, 2 authors, 2012-02-21
STALE5326d

[PATCH 4/9] Bluetooth: mgmt: Fix current settings values when powered off

From: <hidden>
Date: 2012-02-21 16:00:00
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

From: Johan Hedberg <redacted>

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 <redacted>
---
 net/bluetooth/mgmt.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 54df0c0..629bed1 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))
-- 
1.7.9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help