From 2657bbff7f718c5f822bdffd4b10b70ce3b21a33 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 10 Aug 2008 10:23:16 +0200 Subject: The core will remove children in reverse order automatically --- plugins/ipv4.c | 10 ---------- plugins/resolvconf.c | 9 --------- plugins/resolvfile.c | 10 ---------- 3 files changed, 29 deletions(-) diff --git a/plugins/ipv4.c b/plugins/ipv4.c index 9654c764..17d6c534 100644 --- a/plugins/ipv4.c +++ b/plugins/ipv4.c @@ -204,8 +204,6 @@ static int ipv4_probe(struct connman_element *element) resolver->type = CONNMAN_ELEMENT_TYPE_RESOLVER; resolver->netdev.name = g_strdup(element->netdev.name); - connman_element_set_data(element, resolver); - connman_element_register(resolver, element); return 0; @@ -213,16 +211,8 @@ static int ipv4_probe(struct connman_element *element) static void ipv4_remove(struct connman_element *element) { - struct connman_element *resolver = connman_element_get_data(element); - DBG("element %p name %s", element, element->name); - connman_element_set_data(element, NULL); - - connman_element_unregister(resolver); - - connman_element_unref(resolver); - clear_ipv4(element); } diff --git a/plugins/resolvconf.c b/plugins/resolvconf.c index b0650603..e512f2b7 100644 --- a/plugins/resolvconf.c +++ b/plugins/resolvconf.c @@ -64,8 +64,6 @@ static int resolvconf_probe(struct connman_element *element) internet->type = CONNMAN_ELEMENT_TYPE_INTERNET; - connman_element_set_data(element, internet); - connman_element_register(internet, element); return 0; @@ -73,18 +71,11 @@ static int resolvconf_probe(struct connman_element *element) static void resolvconf_remove(struct connman_element *element) { - struct connman_element *internet = connman_element_get_data(element); gchar *cmd; int err; DBG("element %p name %s", element, element->name); - connman_element_set_data(element, NULL); - - connman_element_unregister(internet); - - connman_element_unref(internet); - cmd = g_strdup_printf("%s -d %s", RESOLVCONF, element->netdev.name); DBG("%s", cmd); diff --git a/plugins/resolvfile.c b/plugins/resolvfile.c index bf480818..5ea3422d 100644 --- a/plugins/resolvfile.c +++ b/plugins/resolvfile.c @@ -67,8 +67,6 @@ static int resolvfile_probe(struct connman_element *element) internet->type = CONNMAN_ELEMENT_TYPE_INTERNET; - connman_element_set_data(element, internet); - connman_element_register(internet, element); return 0; @@ -76,15 +74,7 @@ static int resolvfile_probe(struct connman_element *element) static void resolvfile_remove(struct connman_element *element) { - struct connman_element *internet = connman_element_get_data(element); - DBG("element %p name %s", element, element->name); - - connman_element_set_data(element, NULL); - - connman_element_unregister(internet); - - connman_element_unref(internet); } static struct connman_driver resolvfile_driver = { -- cgit v1.2.3