All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluez5: Move ref / unref handsfree audio
@ 2013-02-27 21:49 Paulo Borges
  2013-03-01 19:23 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Paulo Borges @ 2013-02-27 21:49 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]

This commit moves the ref / unref to hfp_hf_bluez5 to make
bluez5 more generic and reusable.
---
 plugins/bluez5.c        |   15 +--------------
 plugins/hfp_hf_bluez5.c |    5 +++++
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/plugins/bluez5.c b/plugins/bluez5.c
index 788f3a2..9233a2b 100644
--- a/plugins/bluez5.c
+++ b/plugins/bluez5.c
@@ -35,7 +35,6 @@
 #include <ofono/dbus.h>
 #include <ofono/plugin.h>
 #include <ofono/log.h>
-#include <ofono/handsfree-audio.h>
 
 #include <gdbus/gdbus.h>
 #include "bluez5.h"
@@ -257,17 +256,5 @@ void bt_disconnect_profile(DBusConnection *conn,
 							cb, user_data);
 }
 
-static int bluez5_init(void)
-{
-	ofono_handsfree_audio_ref();
-
-	return 0;
-}
-
-static void bluez5_exit(void)
-{
-	ofono_handsfree_audio_unref();
-}
-
 OFONO_PLUGIN_DEFINE(bluez5, "BlueZ 5 Utils Plugin", VERSION,
-			OFONO_PLUGIN_PRIORITY_DEFAULT, bluez5_init, bluez5_exit)
+			OFONO_PLUGIN_PRIORITY_DEFAULT, NULL, NULL)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 7057d71..ad52027 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -47,6 +47,7 @@
 #include <ofono/voicecall.h>
 #include <ofono/call-volume.h>
 #include <ofono/handsfree.h>
+#include <ofono/handsfree-audio.h>
 
 #include <drivers/hfpmodem/slc.h>
 
@@ -683,6 +684,8 @@ static int hfp_init(void)
 	g_dbus_client_set_proxy_handlers(bluez, proxy_added, NULL,
 						property_changed, NULL);
 
+	ofono_handsfree_audio_ref();
+
 	return 0;
 }
 
@@ -698,6 +701,8 @@ static void hfp_exit(void)
 
 	if (sco_watch > 0)
 		g_source_remove(sco_watch);
+
+	ofono_handsfree_audio_unref();
 }
 
 OFONO_PLUGIN_DEFINE(hfp_bluez5, "External Hands-Free Profile Plugin", VERSION,
-- 
1.7.9.5


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

* Re: [PATCH] bluez5: Move ref / unref handsfree audio
  2013-02-27 21:49 [PATCH] bluez5: Move ref / unref handsfree audio Paulo Borges
@ 2013-03-01 19:23 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2013-03-01 19:23 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Hi Paulo,

On 02/27/2013 03:49 PM, Paulo Borges wrote:
> This commit moves the ref / unref to hfp_hf_bluez5 to make
> bluez5 more generic and reusable.
> ---
>   plugins/bluez5.c        |   15 +--------------
>   plugins/hfp_hf_bluez5.c |    5 +++++
>   2 files changed, 6 insertions(+), 14 deletions(-)
>

Patch has been applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2013-03-01 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 21:49 [PATCH] bluez5: Move ref / unref handsfree audio Paulo Borges
2013-03-01 19:23 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.