From 2020a2813b0a9f8dee53ea9632296db7d914a619 Mon Sep 17 00:00:00 2001 From: Alok Barsode Date: Wed, 24 Aug 2011 16:44:12 +0300 Subject: [PATCH] technology: Remove the global device hash There is a device list per technology. Hence removing the global device hash. --- src/technology.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/technology.c b/src/technology.c index 849d72a..eee4981 100644 --- a/src/technology.c +++ b/src/technology.c @@ -32,7 +32,6 @@ static DBusConnection *connection; -static GHashTable *device_table; static GSList *technology_list = NULL; struct connman_rfkill { @@ -614,13 +613,6 @@ void __connman_technology_remove_interface(enum connman_service_type type, technology_put(technology); } -static void unregister_technology(gpointer data) -{ - struct connman_technology *technology = data; - - technology_put(technology); -} - int __connman_technology_add_device(struct connman_device *device) { struct connman_technology *technology; @@ -635,8 +627,6 @@ int __connman_technology_add_device(struct connman_device *device) if (technology == NULL) return -ENXIO; - g_hash_table_insert(device_table, device, technology); - if (g_atomic_int_get(&technology->blocked)) goto done; @@ -662,7 +652,7 @@ int __connman_technology_remove_device(struct connman_device *device) type = __connman_device_get_service_type(device); __connman_notifier_unregister(type); - technology = g_hash_table_lookup(device_table, device); + technology = technology_find(type); if (technology == NULL) return -ENXIO; @@ -673,8 +663,6 @@ int __connman_technology_remove_device(struct connman_device *device) state_changed(technology); } - g_hash_table_remove(device_table, device); - return 0; } @@ -1025,9 +1013,6 @@ int __connman_technology_init(void) connection = connman_dbus_get_connection(); - device_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, - NULL, unregister_technology); - return 0; } @@ -1035,7 +1020,5 @@ void __connman_technology_cleanup(void) { DBG(""); - g_hash_table_destroy(device_table); - dbus_connection_unref(connection); } -- 2.7.4