summaryrefslogtreecommitdiff
path: root/drivers/stemodem
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-08-12 23:44:07 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-08-12 23:44:07 -0500
commit361773f4d8d74773cdae0a6b204479440876f1b7 (patch)
tree1313569417fdf17ec647814e16a85c436fabe888 /drivers/stemodem
parent71d309ab50662627c0edc1d0f827691ff98c7f61 (diff)
stemodem: Use g_at_chat_clone
Diffstat (limited to 'drivers/stemodem')
-rw-r--r--drivers/stemodem/gprs-context.c4
-rw-r--r--drivers/stemodem/voicecall.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c
index 7ac07c97..ace9d6e9 100644
--- a/drivers/stemodem/gprs-context.c
+++ b/drivers/stemodem/gprs-context.c
@@ -512,7 +512,7 @@ static int ste_gprs_context_probe(struct ofono_gprs_context *gc,
int i;
gcd = g_new0(struct gprs_context_data, 1);
- gcd->chat = chat;
+ gcd->chat = g_at_chat_clone(chat);
g_at_chat_register(gcd->chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);
@@ -536,6 +536,8 @@ static void ste_gprs_context_remove(struct ofono_gprs_context *gc)
g_caif_devices = NULL;
ofono_gprs_context_set_data(gc, NULL);
+
+ g_at_chat_unref(gcd->chat);
g_free(gcd);
}
diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
index daadf54e..db3b7219 100644
--- a/drivers/stemodem/voicecall.c
+++ b/drivers/stemodem/voicecall.c
@@ -540,12 +540,12 @@ static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
struct voicecall_data *vd;
vd = g_new0(struct voicecall_data, 1);
- vd->chat = chat;
+ vd->chat = g_at_chat_clone(chat);
ofono_voicecall_set_data(vc, vd);
- g_at_chat_send(chat, "AT*ECAM=1", NULL, NULL, NULL, NULL);
- g_at_chat_register(chat, "*ECAV:", ecav_notify, FALSE, vc, NULL);
+ g_at_chat_send(vd->chat, "AT*ECAM=1", NULL, NULL, NULL, NULL);
+ g_at_chat_register(vd->chat, "*ECAV:", ecav_notify, FALSE, vc, NULL);
ofono_voicecall_register(vc);
return 0;
@@ -560,6 +560,7 @@ static void ste_voicecall_remove(struct ofono_voicecall *vc)
ofono_voicecall_set_data(vc, NULL);
+ g_at_chat_unref(vd->chat);
g_free(vd);
}