isimodem: remove atoms that fail to probe

This commit is contained in:
Mika Liljeberg 2011-03-31 11:28:53 +03:00 committed by Denis Kenzior
parent 76d221ecaf
commit c9a5b5143c
15 changed files with 44 additions and 17 deletions

View File

@ -67,8 +67,10 @@ static void isi_call_verify_cb(const GIsiMessage *msg, void *data)
struct ofono_audio_settings *as = data; struct ofono_audio_settings *as = data;
struct audio_settings_data *asd = ofono_audio_settings_get_data(as); struct audio_settings_data *asd = ofono_audio_settings_get_data(as);
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_audio_settings_remove(as);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -383,8 +383,10 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
{ {
struct ofono_call_barring *barr = data; struct ofono_call_barring *barr = data;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_call_barring_remove(barr);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -410,8 +410,10 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
{ {
struct ofono_call_forwarding *cf = data; struct ofono_call_forwarding *cf = data;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_call_forwarding_remove(cf);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -358,8 +358,10 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
{ {
struct ofono_call_settings *cs = data; struct ofono_call_settings *cs = data;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_call_settings_remove(cs);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -133,8 +133,11 @@ static void routing_resp_cb(const GIsiMessage *msg, void *data)
struct ofono_cbs *cbs = data; struct ofono_cbs *cbs = data;
struct cbs_data *cd = ofono_cbs_get_data(cbs); struct cbs_data *cd = ofono_cbs_get_data(cbs);
if (cd == NULL || !check_response_status(msg, SMS_GSM_CB_ROUTING_RESP)) if (cd == NULL ||
!check_response_status(msg, SMS_GSM_CB_ROUTING_RESP)) {
ofono_cbs_remove(cbs);
return; return;
}
g_isi_client_ntf_subscribe(cd->client, SMS_GSM_CB_ROUTING_NTF, g_isi_client_ntf_subscribe(cd->client, SMS_GSM_CB_ROUTING_NTF,
routing_ntf_cb, cbs); routing_ntf_cb, cbs);

View File

@ -205,8 +205,10 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
{ {
struct ofono_devinfo *info = data; struct ofono_devinfo *info = data;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_devinfo_remove(info);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -601,10 +601,12 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
static void gpds_ctx_reachable_cb(const GIsiMessage *msg, void *opaque) static void gpds_ctx_reachable_cb(const GIsiMessage *msg, void *opaque)
{ {
struct context_data *cd = opaque; struct ofono_gprs_context *gc = opaque;
struct context_data *cd = ofono_gprs_context_get_data(gc);
if (g_isi_msg_error(msg) < 0) { if (g_isi_msg_error(msg) < 0) {
DBG("unable to bootstrap gprs context driver"); DBG("unable to bootstrap gprs context driver");
ofono_gprs_context_remove(gc);
return; return;
} }
@ -630,7 +632,7 @@ static int isi_gprs_context_probe(struct ofono_gprs_context *gc,
cd->context = gc; cd->context = gc;
ofono_gprs_context_set_data(gc, cd); ofono_gprs_context_set_data(gc, cd);
g_isi_client_verify(cd->client, gpds_ctx_reachable_cb, cd, NULL); g_isi_client_verify(cd->client, gpds_ctx_reachable_cb, gc, NULL);
return 0; return 0;
} }

View File

@ -265,6 +265,7 @@ static void gpds_reachable_cb(const GIsiMessage *msg, void *opaque)
if (g_isi_msg_error(msg) < 0) { if (g_isi_msg_error(msg) < 0) {
DBG("unable to bootstrap gprs driver"); DBG("unable to bootstrap gprs driver");
ofono_gprs_remove(gprs);
return; return;
} }

View File

@ -933,14 +933,13 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
struct ofono_netreg *netreg = data; struct ofono_netreg *netreg = data;
struct netreg_data *nd = ofono_netreg_get_data(netreg); struct netreg_data *nd = ofono_netreg_get_data(netreg);
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_netreg_remove(netreg);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);
if (nd == NULL)
return;
nd->version.major = g_isi_msg_version_major(msg); nd->version.major = g_isi_msg_version_major(msg);
nd->version.minor = g_isi_msg_version_minor(msg); nd->version.minor = g_isi_msg_version_minor(msg);

View File

@ -294,8 +294,10 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
{ {
struct ofono_phonebook *pb = data; struct ofono_phonebook *pb = data;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_phonebook_remove(pb);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -304,8 +304,10 @@ static void gss_reachable_cb(const GIsiMessage *msg, void *opaque)
{ {
struct ofono_radio_settings *rs = opaque; struct ofono_radio_settings *rs = opaque;
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_radio_settings_remove(rs);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -872,6 +872,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
if (g_isi_msg_error(msg) < 0) { if (g_isi_msg_error(msg) < 0) {
DBG("PN_SIM: %s", strerror(-g_isi_msg_error(msg))); DBG("PN_SIM: %s", strerror(-g_isi_msg_error(msg)));
ofono_sim_remove(sim);
return; return;
} }

View File

@ -602,8 +602,10 @@ static void routing_resp_cb(const GIsiMessage *msg, void *data)
struct ofono_sms *sms = data; struct ofono_sms *sms = data;
struct sms_data *sd = ofono_sms_get_data(sms); struct sms_data *sd = ofono_sms_get_data(sms);
if (!check_sms_status(msg, SMS_PP_ROUTING_RESP)) if (!check_sms_status(msg, SMS_PP_ROUTING_RESP)) {
ofono_sms_remove(sms);
return; return;
}
g_isi_client_ntf_subscribe(sd->client, SMS_PP_ROUTING_NTF, g_isi_client_ntf_subscribe(sd->client, SMS_PP_ROUTING_NTF,
routing_ntf_cb, sms); routing_ntf_cb, sms);
@ -647,6 +649,7 @@ static void sms_reachable_cb(const GIsiMessage *msg, void *data)
if (g_isi_msg_error(msg) < 0) { if (g_isi_msg_error(msg) < 0) {
DBG("unable to find SMS resource"); DBG("unable to find SMS resource");
ofono_sms_remove(sms);
return; return;
} }

View File

@ -226,8 +226,10 @@ static void ussd_reachable_cb(const GIsiMessage *msg, void *data)
struct ofono_ussd *ussd = data; struct ofono_ussd *ussd = data;
struct ussd_data *ud = ofono_ussd_get_data(ussd); struct ussd_data *ud = ofono_ussd_get_data(ussd);
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_ussd_remove(ussd);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);

View File

@ -1764,8 +1764,10 @@ static void call_verify_cb(const GIsiMessage *msg, void *data)
struct ofono_voicecall *ovc = data; struct ofono_voicecall *ovc = data;
struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc); struct isi_voicecall *ivc = ofono_voicecall_get_data(ovc);
if (g_isi_msg_error(msg) < 0) if (g_isi_msg_error(msg) < 0) {
ofono_voicecall_remove(ovc);
return; return;
}
ISI_VERSION_DBG(msg); ISI_VERSION_DBG(msg);