sim: Revert adding special callback for EFiccid
authorDenis Kenzior <denkenz@gmail.com>
Sat, 16 Jun 2012 13:18:16 +0000 (08:18 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Sat, 16 Jun 2012 14:50:05 +0000 (09:50 -0500)
This reverts commit 1960dbbc79e43f33f23886c2a12e508a0350aad1.

include/sim.h
src/sim.c

index cd2f1e3..508ff24 100644 (file)
@@ -94,9 +94,6 @@ typedef void (*ofono_sim_read_cb_t)(const struct ofono_error *error,
 typedef void (*ofono_sim_write_cb_t)(const struct ofono_error *error,
                                        void *data);
 
-typedef void (*ofono_sim_iccid_cb_t)(const struct ofono_error *error,
-                                       const char *iccid, void *data);
-
 typedef void (*ofono_sim_imsi_cb_t)(const struct ofono_error *error,
                                        const char *imsi, void *data);
 
@@ -147,8 +144,6 @@ struct ofono_sim_driver {
        void (*write_file_cyclic)(struct ofono_sim *sim, int fileid,
                        int length, const unsigned char *value,
                        ofono_sim_write_cb_t cb, void *data);
-       void (*read_iccid)(struct ofono_sim *sim,
-                       ofono_sim_iccid_cb_t cb, void *data);
        void (*read_imsi)(struct ofono_sim *sim,
                        ofono_sim_imsi_cb_t cb, void *data);
        void (*query_passwd_state)(struct ofono_sim *sim,
index f02aced..a9222af 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
@@ -1965,25 +1965,6 @@ skip_efpl:
        sim->language_prefs_update = FALSE;
 }
 
-static void sim_iccid_cb(const struct ofono_error *error, const char *iccid,
-                                                       void *userdata)
-{
-       struct ofono_sim *sim = userdata;
-       const char *path = __ofono_atom_get_path(sim->atom);
-       DBusConnection *conn = ofono_dbus_get_connection();
-
-       if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
-               return;
-
-       sim->iccid = g_strdup(iccid);
-
-       ofono_dbus_signal_property_changed(conn, path,
-                                               OFONO_SIM_MANAGER_INTERFACE,
-                                               "CardIdentifier",
-                                               DBUS_TYPE_STRING,
-                                               &sim->iccid);
-}
-
 static void sim_iccid_read_cb(int ok, int length, int record,
                                const unsigned char *data,
                                int record_length, void *userdata)
@@ -1993,13 +1974,7 @@ static void sim_iccid_read_cb(int ok, int length, int record,
        DBusConnection *conn = ofono_dbus_get_connection();
        char iccid[21]; /* ICCID max length is 20 + 1 for NULL */
 
-       if (!ok) {
-               if (sim->driver->read_iccid)
-                       sim->driver->read_iccid(sim, sim_iccid_cb, sim);
-               return;
-       }
-
-       if (length < 10)
+       if (!ok || length < 10)
                return;
 
        extract_bcd_number(data, length, iccid);