summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-03-11 13:24:52 -0600
committerDenis Kenzior <denkenz@gmail.com>2011-03-11 13:50:31 -0600
commit0f147e1cd5c476fd2b4eed073e6f8052da05a957 (patch)
tree2fa0014a6610a3c8a63be5a592722755e8c50299
parent3370b454777a9fa4c94c9932f0907e4aa8d87c35 (diff)
downloadofono-0f147e1cd5c476fd2b4eed073e6f8052da05a957.tar.bz2
voicecall: Minor nitpicks to previous commit
-rw-r--r--drivers/atmodem/voicecall.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c
index 7d70c850..fd15281c 100644
--- a/drivers/atmodem/voicecall.c
+++ b/drivers/atmodem/voicecall.c
@@ -992,7 +992,7 @@ static void cssu_notify(GAtResult *result, gpointer user_data)
struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
int code;
- int index = -1;
+ int index;
const char *num;
struct ofono_phone_number ph;
@@ -1007,9 +1007,7 @@ static void cssu_notify(GAtResult *result, gpointer user_data)
if (!g_at_result_iter_next_number(&iter, &code))
return;
- /* This field is optional, if we can't read it, try to skip it */
- if (!g_at_result_iter_next_number(&iter, &index) &&
- !g_at_result_iter_skip_next(&iter))
+ if (!g_at_result_iter_next_number_default(&iter, -1, &index))
goto out;
if (!g_at_result_iter_next_string(&iter, &num))
@@ -1068,13 +1066,13 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,
no_answer_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "BUSY", busy_notify, FALSE, vc, NULL);
+ g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL);
+ g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL);
+
ofono_voicecall_register(vc);
/* Populate the call list */
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix, clcc_cb, vc, NULL);
-
- g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL);
- g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL);
}
static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,