linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu A Wang <arron.wang@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Yu A Wang <arron.wang@intel.com>
Subject: [PATCH 2/2] rfkill: Set device powered even adapter is not created
Date: Mon, 16 Jan 2012 04:02:50 -0500	[thread overview]
Message-ID: <1326704570-22854-1-git-send-email-arron.wang@intel.com> (raw)

---
 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


             reply	other threads:[~2012-01-16  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  9:02 Yu A Wang [this message]
2012-04-19  7:45 ` [PATCH 2/2] rfkill: Set device powered even adapter is not created 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326704570-22854-1-git-send-email-arron.wang@intel.com \
    --to=arron.wang@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).