Skip to contentSkip to conversation

audio/AVDTP: Remove avdtp_init and avdtp_exit

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Nov 11, 2013 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v2 1/1 audio/AVDTP: Remove avdtp_init and avdtp_exit

From: Luiz Augusto von Dentz <[email protected]>

This is now done on demand by avdtp_register_sep and avdtp_unregister_sep so the server socket is only registered when there is an endpoint available and the record is properly registered.
---
v2: Fix return of avdtp_server_init

 profiles/audio/a2dp.c  |  11 -----
 profiles/audio/avdtp.c | 118 +++++++++++++++++++++++++------------------------
 profiles/audio/avdtp.h |   3 --
 3 files changed, 60 insertions(+), 72 deletions(-)
profiles/audio/a2dp.c +0 -11
index 8477b5d..6b3d6b2 100644
@@ -1187,17 +1187,8 @@ static struct a2dp_server *find_server(GSList *list, struct btd_adapter *a)
 static struct a2dp_server *a2dp_server_register(struct btd_adapter *adapter)
 {
 	struct a2dp_server *server;
-	int av_err;
 
 	server = g_new0(struct a2dp_server, 1);
-
-	av_err = avdtp_init(adapter);
-	if (av_err < 0) {
-		DBG("AVDTP not registered");
-		g_free(server);
-		return NULL;
-	}
-
 	server->adapter = btd_adapter_ref(adapter);
 	servers = g_slist_append(servers, server);
 
@@ -1217,8 +1208,6 @@ static void a2dp_unregister_sep(struct a2dp_sep *sep)
 
 static void a2dp_server_unregister(struct a2dp_server *server)
 {
-	avdtp_exit(server->adapter);
-
 	servers = g_slist_remove(servers, server);
 	btd_adapter_unref(server->adapter);
 	g_free(server);
profiles/audio/avdtp.c +60 -58

150 lines not on this page · raw message

profiles/audio/avdtp.h +0 -3
index 3bf7503..5606506 100644
@@ -308,6 +308,3 @@ struct btd_adapter *avdtp_get_adapter(struct avdtp *session);
 struct btd_device *avdtp_get_device(struct avdtp *session);
 
 void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc);
-
-int avdtp_init(struct btd_adapter *adapter);
-void avdtp_exit(struct btd_adapter *adapter);
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Luiz,

Quoted 10 lines · Luiz Augusto von Dentz

This is now done on demand by avdtp_register_sep and avdtp_unregister_sep so the server socket is only registered when there is an endpoint available and the record is properly registered.
---
v2: Fix return of avdtp_server_init

 profiles/audio/a2dp.c  |  11 -----
 profiles/audio/avdtp.c | 118 +++++++++++++++++++++++++------------------------
 profiles/audio/avdtp.h |   3 --
 3 files changed, 60 insertions(+), 72 deletions(-)

Applied. Thanks.

Johan