Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Szymon Janc <szymon.janc@gmail.com>
Subject: [PATCH 3/5] android: Remove not needed adapter parameter from bt_adapter_ready
Date: Thu, 24 Oct 2013 10:36:51 +0200	[thread overview]
Message-ID: <1382603813-9157-3-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1382603813-9157-1-git-send-email-szymon.janc@tieto.com>

From: Szymon Janc <szymon.janc@gmail.com>

There is no need to pass adapter pointer in bt_adapter_ready callback
as there is only one present.
---
 android/adapter.c | 6 +++---
 android/adapter.h | 4 +---
 android/main.c    | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/android/adapter.c b/android/adapter.c
index d85fa1f..0a53021 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -201,11 +201,11 @@ static void load_link_keys_complete(uint8_t status, uint16_t length,
 	DBG("status %u", status);
 
 	default_adapter = adapter;
-	adapter->ready(adapter, 0);
+	adapter->ready(0);
 	return;
 
 failed:
-	adapter->ready(NULL, err);
+	adapter->ready(err);
 }
 
 static void load_link_keys(struct bt_adapter *adapter, GSList *keys)
@@ -274,7 +274,7 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
 	return;
 
 failed:
-	adapter->ready(NULL, err);
+	adapter->ready(err);
 }
 
 void bt_adapter_init(uint16_t index, struct mgmt *mgmt_if,
diff --git a/android/adapter.h b/android/adapter.h
index 9ae2d33..3d7b804 100644
--- a/android/adapter.h
+++ b/android/adapter.h
@@ -28,9 +28,7 @@
 
 #include "lib/bluetooth.h"
 
-struct bt_adapter;
-
-typedef void (*bt_adapter_ready)(struct bt_adapter *adapter, int err);
+typedef void (*bt_adapter_ready)(int err);
 
 void bt_adapter_init(uint16_t index, struct mgmt *mgmt_if,
 						bt_adapter_ready func);
diff --git a/android/main.c b/android/main.c
index 740b532..50b5901 100644
--- a/android/main.c
+++ b/android/main.c
@@ -392,7 +392,7 @@ static GOptionEntry options[] = {
 	{ NULL }
 };
 
-static void adapter_ready(struct bt_adapter *adapter, int err)
+static void adapter_ready(int err)
 {
 	if (err) {
 		error("Adapter initialization failed: %s", strerror(err));
-- 
1.8.4


  parent reply	other threads:[~2013-10-24  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  8:36 [PATCH 1/5] android: Start command watch after notify channel is connected Szymon Janc
2013-10-24  8:36 ` [PATCH 2/5] android: Fix bt_adapter_init Szymon Janc
2013-10-24  8:36 ` Szymon Janc [this message]
2013-10-24  8:36 ` [PATCH 4/5] android: Use default adapter in adapter functions Szymon Janc
2013-10-24  8:36 ` [PATCH 5/5] android: Use adapter index in mgmt functions Szymon Janc

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=1382603813-9157-3-git-send-email-szymon.janc@tieto.com \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@gmail.com \
    /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