mirror of git://git.sysmocom.de/ofono
plugins: remove NULL check
This commit is contained in:
parent
f9b34de3d4
commit
8c667aadad
|
@ -251,7 +251,7 @@ static void gobi_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL || data->chat == NULL)
|
if (data->chat == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (g_at_chat_send(data->chat, command, NULL,
|
if (g_at_chat_send(data->chat, command, NULL,
|
||||||
|
|
|
@ -346,13 +346,9 @@ static void hso_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
|
|
@ -661,14 +661,10 @@ static void ifx_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("%p %s", modem, online ? "online" : "offline");
|
DBG("%p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(data->dlcs[AUX_DLC], command, NULL,
|
if (g_at_chat_send(data->dlcs[AUX_DLC], command, NULL,
|
||||||
set_online_cb, cbd, g_free) > 0)
|
set_online_cb, cbd, g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
|
|
@ -470,13 +470,9 @@ static void mbm_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
|
|
@ -309,7 +309,7 @@ static void novatel_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL || chat == NULL)
|
if (chat == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
|
|
|
@ -143,9 +143,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc,
|
||||||
struct cb_data *cbd = cb_data_new(cb, data);
|
struct cb_data *cbd = cb_data_new(cb, data);
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
cbd->user = gc;
|
cbd->user = gc;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "AT+CGACT=0,%u", id);
|
snprintf(buf, sizeof(buf), "AT+CGACT=0,%u", id);
|
||||||
|
@ -154,7 +151,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc,
|
||||||
at_cgact_down_cb, cbd, g_free) > 0)
|
at_cgact_down_cb, cbd, g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, data);
|
CALLBACK_WITH_FAILURE(cb, data);
|
||||||
|
@ -273,14 +269,10 @@ static void phonesim_ctm_query(struct ofono_ctm *ctm,
|
||||||
|
|
||||||
DBG("");
|
DBG("");
|
||||||
|
|
||||||
if (!cbd)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(chat, "AT+PTTY?", ptty_prefix,
|
if (g_at_chat_send(chat, "AT+PTTY?", ptty_prefix,
|
||||||
ctm_query_cb, cbd, g_free) > 0)
|
ctm_query_cb, cbd, g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, 0, data);
|
CALLBACK_WITH_FAILURE(cb, 0, data);
|
||||||
|
@ -305,16 +297,12 @@ static void phonesim_ctm_set(struct ofono_ctm *ctm, ofono_bool_t enable,
|
||||||
|
|
||||||
DBG("");
|
DBG("");
|
||||||
|
|
||||||
if (!cbd)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "AT+PTTY=%d", enable);
|
snprintf(buf, sizeof(buf), "AT+PTTY=%d", enable);
|
||||||
|
|
||||||
if (g_at_chat_send(chat, buf, none_prefix,
|
if (g_at_chat_send(chat, buf, none_prefix,
|
||||||
ctm_set_cb, cbd, g_free) > 0)
|
ctm_set_cb, cbd, g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
CALLBACK_WITH_FAILURE(cb, data);
|
CALLBACK_WITH_FAILURE(cb, data);
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ static void sierra_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL || data->chat == NULL)
|
if (data->chat == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (g_at_chat_send(data->chat, command, NULL,
|
if (g_at_chat_send(data->chat, command, NULL,
|
||||||
|
|
|
@ -320,13 +320,9 @@ static void ste_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
|
|
@ -159,13 +159,9 @@ static void tc65_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
|
|
@ -250,7 +250,7 @@ static void zte_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (cbd == NULL || chat == NULL)
|
if (chat == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
|
||||||
|
|
Loading…
Reference in New Issue