mirror of git://git.sysmocom.de/ofono
hfpmodem: remove NULL check
This commit is contained in:
parent
b6331608c2
commit
0f4b44d5cf
|
@ -73,9 +73,6 @@ static void hfp_speaker_volume(struct ofono_call_volume *cv,
|
|||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
char buf[64];
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
vd->sp_volume = percent;
|
||||
|
||||
snprintf(buf, sizeof(buf), "AT+VGS=%d",
|
||||
|
@ -85,7 +82,6 @@ static void hfp_speaker_volume(struct ofono_call_volume *cv,
|
|||
cv_generic_set_cb, cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -100,9 +96,6 @@ static void hfp_microphone_volume(struct ofono_call_volume *cv,
|
|||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
char buf[64];
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
vd->mic_volume = percent;
|
||||
|
||||
snprintf(buf, sizeof(buf), "AT+VGM=%d",
|
||||
|
@ -112,7 +105,6 @@ static void hfp_microphone_volume(struct ofono_call_volume *cv,
|
|||
cv_generic_set_cb, cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -236,9 +236,6 @@ static void hfp_registration_status(struct ofono_netreg *netreg,
|
|||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
gboolean ok;
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
cbd->user = netreg;
|
||||
|
||||
ok = g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
|
||||
|
@ -246,7 +243,6 @@ static void hfp_registration_status(struct ofono_netreg *netreg,
|
|||
if (ok)
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
|
||||
|
@ -259,9 +255,6 @@ static void hfp_current_operator(struct ofono_netreg *netreg,
|
|||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
gboolean ok;
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
cbd->user = netreg;
|
||||
|
||||
ok = g_at_chat_send(nd->chat, "AT+COPS=3,0", NULL,
|
||||
|
@ -274,7 +267,6 @@ static void hfp_current_operator(struct ofono_netreg *netreg,
|
|||
if (ok)
|
||||
return;
|
||||
|
||||
error:
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
}
|
||||
|
||||
|
@ -284,16 +276,12 @@ static void hfp_signal_strength(struct ofono_netreg *netreg,
|
|||
struct netreg_data *nd = ofono_netreg_get_data(netreg);
|
||||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
cbd->user = netreg;
|
||||
|
||||
if (g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
|
||||
signal_strength_cb, cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
|
|
@ -362,9 +362,6 @@ static void hfp_dial(struct ofono_voicecall *vc,
|
|||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
char buf[256];
|
||||
|
||||
if (cbd == NULL)
|
||||
goto error;
|
||||
|
||||
cbd->user = vc;
|
||||
if (ph->type == 145)
|
||||
snprintf(buf, sizeof(buf), "ATD+%s", ph->number);
|
||||
|
@ -377,7 +374,6 @@ static void hfp_dial(struct ofono_voicecall *vc,
|
|||
atd_cb, cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
error:
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
Loading…
Reference in New Issue