[Patch v2 11/12] timeserver: Remove connman_timeserver_driver framework

Alok Barsode alokbarsode at gmail.com
Fri Feb 3 10:26:05 PST 2012


From: Alok Barsode <alok.barsode at linux.intel.com>

---
 include/timeserver.h |   21 ---------------------
 src/timeserver.c     |   47 -----------------------------------------------
 2 files changed, 0 insertions(+), 68 deletions(-)

diff --git a/include/timeserver.h b/include/timeserver.h
index 83ad557..d124537 100644
--- a/include/timeserver.h
+++ b/include/timeserver.h
@@ -26,30 +26,9 @@
 extern "C" {
 #endif
 
-#define CONNMAN_TIMESERVER_PRIORITY_LOW      -100
-#define CONNMAN_TIMESERVER_PRIORITY_DEFAULT     0
-#define CONNMAN_TIMESERVER_PRIORITY_HIGH      100
-
-/**
- * SECTION:timeserver
- * @title: timeserver premitives
- * @short_description: Functions for handling time servers (including NTP)
- */
-
 int __connman_timeserver_system_append(const char *server);
 int __connman_timeserver_system_remove(const char *server);
 
-struct connman_timeserver_driver {
-	const char *name;
-	int priority;
-	int (*append) (const char *server);
-	int (*remove) (const char *server);
-	void (*sync) (void);
-};
-
-int connman_timeserver_driver_register(struct connman_timeserver_driver *driver);
-void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/timeserver.c b/src/timeserver.c
index 0a268f5..d31801f 100644
--- a/src/timeserver.c
+++ b/src/timeserver.c
@@ -31,9 +31,6 @@
 
 #include "connman.h"
 
-static GSList *driver_list = NULL;
-static GHashTable *server_hash = NULL;
-
 static char **system_timeservers = NULL;
 static char **timeservers = NULL;
 
@@ -88,45 +85,6 @@ static char **load_timeservers()
 	return servers;
 }
 
-static gint compare_priority(gconstpointer a, gconstpointer b)
-{
-	const struct connman_timeserver_driver *driver1 = a;
-	const struct connman_timeserver_driver *driver2 = b;
-
-	return driver2->priority - driver1->priority;
-}
-
-/**
- * connman_timeserver_driver_register:
- * @driver: timeserver driver definition
- *
- * Register a new timeserver driver
- *
- * Returns: %0 on success
- */
-int connman_timeserver_driver_register(struct connman_timeserver_driver *driver)
-{
-	DBG("driver %p name %s", driver, driver->name);
-
-	driver_list = g_slist_insert_sorted(driver_list, driver,
-							compare_priority);
-
-	return 0;
-}
-
-/**
- * connman_timeserver_driver_unregister:
- * @driver: timeserver driver definition
- *
- * Remove a previously registered timeserver driver
- */
-void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver)
-{
-	DBG("driver %p name %s", driver, driver->name);
-
-	driver_list = g_slist_remove(driver_list, driver);
-}
-
 /* Restart NTP procedure */
 static void connman_timeserver_restart()
 {
@@ -379,15 +337,10 @@ int __connman_timeserver_init(void)
 {
 	DBG("");
 
-	server_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
-						g_free, NULL);
-
 	return 0;
 }
 
 void __connman_timeserver_cleanup(void)
 {
 	DBG("");
-
-	g_hash_table_destroy(server_hash);
 }
-- 
1.7.5.4




More information about the connman mailing list