call-forwarding: Use __ofono_atom_find
authorDenis Kenzior <denkenz@gmail.com>
Wed, 18 Jan 2012 17:42:20 +0000 (11:42 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 18 Jan 2012 18:21:36 +0000 (12:21 -0600)
src/call-forwarding.c

index 6254f76..a58ca21 100644 (file)
@@ -1521,7 +1521,6 @@ void ofono_call_forwarding_register(struct ofono_call_forwarding *cf)
        DBusConnection *conn = ofono_dbus_get_connection();
        const char *path = __ofono_atom_get_path(cf->atom);
        struct ofono_modem *modem = __ofono_atom_get_modem(cf->atom);
-       struct ofono_atom *sim_atom;
 
        if (!g_dbus_register_interface(conn, path,
                                        OFONO_CALL_FORWARDING_INTERFACE,
@@ -1535,12 +1534,9 @@ void ofono_call_forwarding_register(struct ofono_call_forwarding *cf)
 
        ofono_modem_add_interface(modem, OFONO_CALL_FORWARDING_INTERFACE);
 
-       sim_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM);
-
-       if (sim_atom) {
-               cf->sim = __ofono_atom_get_data(sim_atom);
+       cf->sim = __ofono_atom_find(OFONO_ATOM_TYPE_SIM, modem);
+       if (cf->sim) {
                cf->sim_context = ofono_sim_context_create(cf->sim);
-
                sim_read_cf_indicator(cf);
        }