linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH_v4 2/7] android/pan: Change local_role to NONE only when device list is empty
Date: Wed, 18 Dec 2013 16:53:11 +0200	[thread overview]
Message-ID: <1387378396-6259-2-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1387378396-6259-1-git-send-email-ravikumar.veeramally@linux.intel.com>

---
 android/pan.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/android/pan.c b/android/pan.c
index 2bbba9e..b83f534 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -67,8 +67,6 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)
 
 static void pan_device_free(struct pan_device *dev)
 {
-	local_role = HAL_PAN_ROLE_NONE;
-
 	if (dev->watch > 0) {
 		g_source_remove(dev->watch);
 		dev->watch = 0;
@@ -81,6 +79,9 @@ static void pan_device_free(struct pan_device *dev)
 
 	devices = g_slist_remove(devices, dev);
 	g_free(dev);
+
+	if (g_slist_length(devices) == 0)
+		local_role = HAL_PAN_ROLE_NONE;
 }
 
 static void bt_pan_notify_conn_state(struct pan_device *dev, uint8_t state)
-- 
1.8.3.2


  reply	other threads:[~2013-12-18 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 14:53 [PATCH_v4 1/7] android/pan: Free device after sending diconnected notification Ravi kumar Veeramally
2013-12-18 14:53 ` Ravi kumar Veeramally [this message]
2013-12-18 14:53 ` [PATCH_v4 3/7] android/pan: shutdown io channel on disconnect call Ravi kumar Veeramally
2013-12-19  8:14   ` Johan Hedberg
2013-12-19  8:48     ` Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 4/7] bnep: Rename struct bnep_conn to struct bnep for better readability Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 5/7] bnep: Add bnep_new and bnep_free api's Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 6/7] bnep: Refactored bnep connect and disconnect calls Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 7/7] bnep: Refactored bnep server apis for bridge addition and deletion Ravi kumar Veeramally

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=1387378396-6259-2-git-send-email-ravikumar.veeramally@linux.intel.com \
    --to=ravikumar.veeramally@linux.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).