diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-09-09 13:38:20 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-09-09 13:38:20 -0500 |
commit | 4a60d69e9868f7e0dc1b9056c4e62e4c8c8a3e61 (patch) | |
tree | 8c061b2b3c9c035c2b9597de527c04d5617db594 | |
parent | 3bbf9b3e2f90e53239591efefc3052bbef8ff311 (diff) | |
download | ofono-4a60d69e9868f7e0dc1b9056c4e62e4c8c8a3e61.tar.bz2 |
modem: Remove unneeded functions
-rw-r--r-- | src/manager.c | 36 | ||||
-rw-r--r-- | src/modem.c | 47 | ||||
-rw-r--r-- | src/ofono.h | 1 |
3 files changed, 0 insertions, 84 deletions
diff --git a/src/manager.c b/src/manager.c index 657f3faa..c7d5d237 100644 --- a/src/manager.c +++ b/src/manager.c @@ -29,47 +29,11 @@ #include "ofono.h" -/* - * Note __ofono_modem_get_list() will abort if it cannot allocate - * memory; so no error path or cleanup is needed. - */ -static DBusMessage *manager_get_properties(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBusMessageIter iter; - DBusMessageIter dict; - DBusMessage *reply; - const char **modems; - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - modems = __ofono_modem_get_list(); - - dbus_message_iter_init_append(reply, &iter); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - OFONO_PROPERTIES_ARRAY_SIGNATURE, - &dict); - - ofono_dbus_dict_append_array(&dict, "Modems", DBUS_TYPE_OBJECT_PATH, - &modems); - - g_free(modems); - - dbus_message_iter_close_container(&iter, &dict); - - return reply; -} - static GDBusMethodTable manager_methods[] = { - { "GetProperties", "", "a{sv}", manager_get_properties }, { } }; static GDBusSignalTable manager_signals[] = { - { "PropertyChanged", "sv" }, { } }; diff --git a/src/modem.c b/src/modem.c index 7266c741..ca2b06ed 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1133,33 +1133,6 @@ void *ofono_devinfo_get_data(struct ofono_devinfo *info) return info->driver_data; } -/* Clients only need to free *modems - * - * Note: this function will never return NULL. It will abort if it - * can't allocate memory for *modems; thus even an empty list will - * returns a non-NULL pointer. - */ -const char **__ofono_modem_get_list() -{ - GSList *l; - int i; - struct ofono_modem *modem; - const char **modems; - - modems = g_new0(const char *, g_slist_length(g_modem_list) + 1); - - for (l = g_modem_list, i = 0; l; l = l->next) { - modem = l->data; - - if (modem->driver == NULL) - continue; - - modems[i++] = modem->path; - } - - return modems; -} - static void unregister_property(gpointer data) { struct modem_property *property = data; @@ -1344,22 +1317,6 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type) return modem; } -static void emit_modems() -{ - DBusConnection *conn = ofono_dbus_get_connection(); - const char **modems = __ofono_modem_get_list(); - - if (modems == NULL) - return; - - ofono_dbus_signal_array_property_changed(conn, - OFONO_MANAGER_PATH, - OFONO_MANAGER_INTERFACE, "Modems", - DBUS_TYPE_OBJECT_PATH, &modems); - - g_free(modems); -} - static void sim_watch(struct ofono_atom *atom, enum ofono_atom_watch_condition cond, void *data) { @@ -1424,8 +1381,6 @@ int ofono_modem_register(struct ofono_modem *modem) modem->atom_watches = __ofono_watchlist_new(g_free); - emit_modems(); - modem->sim_watch = __ofono_modem_add_atom_watch(modem, OFONO_ATOM_TYPE_SIM, sim_watch, modem, NULL); @@ -1478,8 +1433,6 @@ static void modem_unregister(struct ofono_modem *modem) modem->properties = NULL; modem->driver = NULL; - - emit_modems(); } void ofono_modem_remove(struct ofono_modem *modem) diff --git a/src/ofono.h b/src/ofono.h index 16b4aae6..51084249 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -30,7 +30,6 @@ void __ofono_exit(); int __ofono_manager_init(); void __ofono_manager_cleanup(); -const char **__ofono_modem_get_list(); void __ofono_modem_shutdown(); #include <ofono/log.h> |