From 04b5b05b64a613ced1b78ce6e9859f1e10032534 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 25 Jul 2011 16:24:30 +0200 Subject: network: Remove connman_network_register/unregister() Since the service object doesn't take a reference the intermediate step of having a connman_network_register/unregister is not needed. This function are only there to have an additional step where probe()/remove() will be called. This is the job of connman_device_add_network()/connman_device_remove_network(). --- src/network.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/network.c') diff --git a/src/network.c b/src/network.c index 06aec05b..220164a3 100644 --- a/src/network.c +++ b/src/network.c @@ -242,21 +242,6 @@ static void probe_driver(struct connman_network_driver *driver) } } -int connman_network_register(struct connman_network *network) -{ - network_list = g_slist_append(network_list, network); - - return network_probe(network); -} - - -void connman_network_unregister(struct connman_network *network) -{ - network_list = g_slist_remove(network_list, network); - - network_remove(network); -} - static void remove_driver(struct connman_network_driver *driver) { GSList *list; @@ -391,6 +376,8 @@ struct connman_network *connman_network_create(const char *identifier, network->type = type; network->identifier = ident; + network_list = g_slist_append(network_list, network); + return network; } @@ -424,6 +411,8 @@ void connman_network_unref(struct connman_network *network) if (g_atomic_int_dec_and_test(&network->refcount) == FALSE) return; + network_list = g_slist_remove(network_list, network); + network_destruct(network); } -- cgit v1.2.3