summaryrefslogtreecommitdiffstats
path: root/drivers/hfpmodem
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-09-09 00:23:09 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-09-09 01:05:47 -0500
commit586a2a294aaf23e80d237fc4aceb17075eddc35b (patch)
treeb4c643f1b8503812a53a290c224ddd89deddac59 /drivers/hfpmodem
parent4b2b707a30afa8da8a22d8a61b57627815aeb5af (diff)
downloadofono-586a2a294aaf23e80d237fc4aceb17075eddc35b.tar.bz2
call-volume: Use g_idle_add to register
Diffstat (limited to 'drivers/hfpmodem')
-rw-r--r--drivers/hfpmodem/call-volume.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hfpmodem/call-volume.c b/drivers/hfpmodem/call-volume.c
index c0c48699..e86c9f36 100644
--- a/drivers/hfpmodem/call-volume.c
+++ b/drivers/hfpmodem/call-volume.c
@@ -166,7 +166,7 @@ static void sync_microphone_volume_cb(const struct ofono_error *error,
ofono_call_volume_set_microphone_volume(cv, vd->mic_volume);
}
-static void hfp_call_volume_initialized(gpointer user_data)
+static gboolean hfp_call_volume_register(gpointer user_data)
{
struct ofono_call_volume *cv = user_data;
struct cv_data *vd = ofono_call_volume_get_data(cv);
@@ -176,11 +176,13 @@ static void hfp_call_volume_initialized(gpointer user_data)
g_at_chat_register(vd->chat, "+VGS:", vgs_notify, FALSE, cv, NULL);
g_at_chat_register(vd->chat, "+VGM:", vgm_notify, FALSE, cv, NULL);
- ofono_call_volume_register(cv);
-
/* set sp and mic volume at 50 percents by default */
hfp_speaker_volume(cv, 50, sync_speaker_volume_cb, cv);
hfp_microphone_volume(cv, 50, sync_microphone_volume_cb, cv);
+
+ ofono_call_volume_register(cv);
+
+ return FALSE;
}
static int hfp_call_volume_probe(struct ofono_call_volume *cv,
@@ -195,7 +197,7 @@ static int hfp_call_volume_probe(struct ofono_call_volume *cv,
ofono_call_volume_set_data(cv, vd);
- hfp_call_volume_initialized(cv);
+ g_idle_add(hfp_call_volume_register, cv);
return 0;
}