diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-09-11 12:36:35 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-09-11 12:39:56 -0500 |
commit | cbb36acee848bdbfb3480bde3ae6d9ac79137e69 (patch) | |
tree | dde7f149bba50581f0a8ff85fc6fd9529320ce5e /drivers/atmodem/voicecall.c | |
parent | 32fc30fa02a6d46b78f45e446b2347754ba2136a (diff) | |
download | ofono-cbb36acee848bdbfb3480bde3ae6d9ac79137e69.tar.bz2 |
Rework DECLARE_FAILURE to be a bit nicer
Diffstat (limited to 'drivers/atmodem/voicecall.c')
-rw-r--r-- | drivers/atmodem/voicecall.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index e8a2118d..4d6cfd22 100644 --- a/drivers/atmodem/voicecall.c +++ b/drivers/atmodem/voicecall.c @@ -467,10 +467,7 @@ error: if (cbd) g_free(cbd); - { - DECLARE_FAILURE(error); - cb(&error, data); - } + CALLBACK_WITH_FAILURE(cb, data); } static void at_template(const char *cmd, struct ofono_voicecall *vc, @@ -496,10 +493,7 @@ error: if (req) g_free(req); - { - DECLARE_FAILURE(error); - cb(&error, data); - } + CALLBACK_WITH_FAILURE(cb, data); } static void at_answer(struct ofono_voicecall *vc, @@ -536,16 +530,14 @@ static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data) calls = parse_clcc(result); if (calls == NULL) { - DECLARE_FAILURE(e); - cb(&e, 0, NULL, cbd->data); + CALLBACK_WITH_FAILURE(cb, 0, NULL, cbd->data); goto out; } list = g_try_new0(struct ofono_call, g_slist_length(calls)); if (!list) { - DECLARE_FAILURE(e); - cb(&e, 0, NULL, cbd->data); + CALLBACK_WITH_FAILURE(cb, 0, NULL, cbd->data); goto out; } @@ -578,11 +570,7 @@ error: if (cbd) g_free(cbd); - { - DECLARE_FAILURE(error); - cb(&error, 0, NULL, data); - } - + CALLBACK_WITH_FAILURE(cb, 0, NULL, data); } static void at_hold_all_active(struct ofono_voicecall *vc, @@ -637,10 +625,7 @@ error: if (req) g_free(req); - { - DECLARE_FAILURE(error); - cb(&error, data); - } + CALLBACK_WITH_FAILURE(cb, data); } static void at_private_chat(struct ofono_voicecall *vc, int id, @@ -731,10 +716,7 @@ error: if (cbd) g_free(cbd); - { - DECLARE_FAILURE(error); - cb(&error, data); - } + CALLBACK_WITH_FAILURE(cb, data); } static void ring_notify(GAtResult *result, gpointer user_data) |