linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] rfkill: Set device powered even adapter is not created
@ 2012-01-16  9:02 Yu A Wang
  2012-04-19  7:45 ` Johan Hedberg
  0 siblings, 1 reply; 6+ messages in thread
From: Yu A Wang @ 2012-01-16  9:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Yu A Wang

---
 src/rfkill.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/rfkill.c b/src/rfkill.c
index b40c6e7..5d32fac 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -128,11 +128,18 @@ static gboolean rfkill_event(GIOChannel *chan,
 	if (id < 0)
 		return TRUE;
 
+	DBG("RFKILL unblock for hci%d", id);
+
 	adapter = manager_find_adapter_by_id(id);
-	if (!adapter)
+	if (!adapter) {
+		/*
+		 * If device is rfkilled, the initialize operation
+		 * may failed and adapter is not created, then we
+		 * need to set the device powered directly.
+		 */
+		adapter_ops_set_powered(id, TRUE);
 		return TRUE;
-
-	DBG("RFKILL unblock for hci%d", id);
+	}
 
 	btd_adapter_restore_powered(adapter);
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-19 14:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16  9:02 [PATCH 2/2] rfkill: Set device powered even adapter is not created Yu A Wang
2012-04-19  7:45 ` Johan Hedberg
2012-04-19  8:57   ` Wang, Arron
2012-04-19 12:31     ` Johan Hedberg
2012-04-19 12:41       ` Marcel Holtmann
2012-04-19 14:13         ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).