isimodem: remove atoms that fail to probe
authorMika Liljeberg <mika.liljeberg@nokia.com>
Thu, 31 Mar 2011 08:28:53 +0000 (11:28 +0300)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 31 Mar 2011 15:22:22 +0000 (10:22 -0500)
15 files changed:
drivers/isimodem/audio-settings.c
drivers/isimodem/call-barring.c
drivers/isimodem/call-forwarding.c
drivers/isimodem/call-settings.c
drivers/isimodem/cbs.c
drivers/isimodem/devinfo.c
drivers/isimodem/gprs-context.c
drivers/isimodem/gprs.c
drivers/isimodem/network-registration.c
drivers/isimodem/phonebook.c
drivers/isimodem/radio-settings.c
drivers/isimodem/sim.c
drivers/isimodem/sms.c
drivers/isimodem/ussd.c
drivers/isimodem/voicecall.c

index 65c596b..fd21dec 100644 (file)
@@ -67,8 +67,10 @@ static void isi_call_verify_cb(const GIsiMessage *msg, void *data)
        struct ofono_audio_settings *as = data;
        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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 5eb06ca..ea425e2 100644 (file)
@@ -383,8 +383,10 @@ static void reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 52c28fe..888314d 100644 (file)
@@ -410,8 +410,10 @@ static void reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 9fb17df..9270f5f 100644 (file)
@@ -358,8 +358,10 @@ static void reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index b969c1f..11b7aff 100644 (file)
@@ -133,8 +133,11 @@ static void routing_resp_cb(const GIsiMessage *msg, void *data)
        struct ofono_cbs *cbs = data;
        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;
+       }
 
        g_isi_client_ntf_subscribe(cd->client, SMS_GSM_CB_ROUTING_NTF,
                                        routing_ntf_cb, cbs);
index 3bf05f4..62dd2d1 100644 (file)
@@ -205,8 +205,10 @@ static void reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 329ef21..8d68213 100644 (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)
 {
-       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) {
                DBG("unable to bootstrap gprs context driver");
+               ofono_gprs_context_remove(gc);
                return;
        }
 
@@ -630,7 +632,7 @@ static int isi_gprs_context_probe(struct ofono_gprs_context *gc,
        cd->context = gc;
        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;
 }
index ea90704..d4d7ebf 100644 (file)
@@ -265,6 +265,7 @@ static void gpds_reachable_cb(const GIsiMessage *msg, void *opaque)
 
        if (g_isi_msg_error(msg) < 0) {
                DBG("unable to bootstrap gprs driver");
+               ofono_gprs_remove(gprs);
                return;
        }
 
index 8bf2423..56c3bb8 100644 (file)
@@ -933,14 +933,13 @@ static void reachable_cb(const GIsiMessage *msg, void *data)
        struct ofono_netreg *netreg = data;
        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;
+       }
 
        ISI_VERSION_DBG(msg);
 
-       if (nd == NULL)
-               return;
-
        nd->version.major = g_isi_msg_version_major(msg);
        nd->version.minor = g_isi_msg_version_minor(msg);
 
index 1f92d37..4c68e31 100644 (file)
@@ -294,8 +294,10 @@ static void reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 5d99213..a2a521b 100644 (file)
@@ -304,8 +304,10 @@ static void gss_reachable_cb(const GIsiMessage *msg, void *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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index a602e39..f5fa75d 100644 (file)
@@ -872,6 +872,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
 
        if (g_isi_msg_error(msg) < 0) {
                DBG("PN_SIM: %s", strerror(-g_isi_msg_error(msg)));
+               ofono_sim_remove(sim);
                return;
        }
 
index c90c06d..6f6b247 100644 (file)
@@ -602,8 +602,10 @@ static void routing_resp_cb(const GIsiMessage *msg, void *data)
        struct ofono_sms *sms = data;
        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;
+       }
 
        g_isi_client_ntf_subscribe(sd->client, SMS_PP_ROUTING_NTF,
                                        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) {
                DBG("unable to find SMS resource");
+               ofono_sms_remove(sms);
                return;
        }
 
index f0b7392..ee5c095 100644 (file)
@@ -226,8 +226,10 @@ static void ussd_reachable_cb(const GIsiMessage *msg, void *data)
        struct ofono_ussd *ussd = data;
        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;
+       }
 
        ISI_VERSION_DBG(msg);
 
index 92d98ab..5cbba1f 100644 (file)
@@ -1764,8 +1764,10 @@ static void call_verify_cb(const GIsiMessage *msg, void *data)
        struct ofono_voicecall *ovc = data;
        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;
+       }
 
        ISI_VERSION_DBG(msg);