summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-07-25 16:24:30 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-07-26 01:21:06 +0200
commit04b5b05b64a613ced1b78ce6e9859f1e10032534 (patch)
tree5248ef24bd922caf8baf005446427a98f9542ee8 /plugins
parent4c769d10c89d516c6901243142b1efa64ab208ad (diff)
downloadconnman-04b5b05b64a613ced1b78ce6e9859f1e10032534.tar.gz
connman-04b5b05b64a613ced1b78ce6e9859f1e10032534.tar.bz2
connman-04b5b05b64a613ced1b78ce6e9859f1e10032534.zip
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().
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bluetooth.c3
-rw-r--r--plugins/ethernet.c3
-rw-r--r--plugins/ofono.c4
-rw-r--r--plugins/wifi.c8
4 files changed, 4 insertions, 14 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index d112f876..ccc5e9bb 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -215,7 +215,6 @@ done:
dbus_pending_call_unref(call);
- connman_network_unregister(network);
connman_network_unref(network);
}
@@ -439,8 +438,6 @@ static void network_properties_reply(DBusPendingCall *call, void *user_data)
if (network == NULL)
goto done;
- connman_network_register(network);
-
connman_network_set_string(network, "Path", path);
connman_network_set_name(network, name);
diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index 4829a33b..2ccd4989 100644
--- a/plugins/ethernet.c
+++ b/plugins/ethernet.c
@@ -92,15 +92,12 @@ static void add_network(struct connman_device *device)
if (network == NULL)
return;
- connman_network_register(network);
-
index = connman_device_get_index(device);
connman_network_set_index(network, index);
connman_network_set_name(network, "Wired");
if (connman_device_add_network(device, network) < 0) {
- connman_network_unregister(network);
connman_network_unref(network);
return;
}
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 5a608823..9cc48c60 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -365,7 +365,6 @@ static void remove_network(gpointer data)
{
struct network_info *info = data;
- connman_network_unregister(info->network);
connman_network_unref(info->network);
g_free(info);
@@ -833,11 +832,8 @@ static int add_network(struct connman_device *device,
if (network == NULL)
return -ENOMEM;
- connman_network_register(network);
-
info = g_try_new0(struct network_info, 1);
if (info == NULL) {
- connman_network_unregister(network);
connman_network_unref(network);
return -ENOMEM;
}
diff --git a/plugins/wifi.c b/plugins/wifi.c
index f4e51b24..8a7da099 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -793,8 +793,6 @@ static void network_added(GSupplicantNetwork *supplicant_network)
if (network == NULL)
return;
- connman_network_register(network);
-
connman_network_set_index(network, wifi->index);
if (connman_device_add_network(wifi->device, network) < 0) {
@@ -835,10 +833,12 @@ static void network_removed(GSupplicantNetwork *network)
if (wifi != NULL) {
connman_network = connman_device_get_network(wifi->device, identifier);
- if (connman_network != NULL)
- connman_network_unregister(connman_network);
connman_device_remove_network(wifi->device, identifier);
+
+ if (connman_network != NULL)
+ connman_network_unref(connman_network);
+
}
}