From 51427d85169ac361bc9fe02619a9a54566880577 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 10 Jan 2011 15:08:01 -0600 Subject: tc65: No need to g_strdup options in the hashtable --- plugins/tc65.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/tc65.c b/plugins/tc65.c index e1a8cfab..68f6246e 100644 --- a/plugins/tc65.c +++ b/plugins/tc65.c @@ -79,8 +79,7 @@ static int tc65_enable(struct ofono_modem *modem) DBG("%p", modem); - options = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, - g_free); + options = g_hash_table_new(g_str_hash, g_str_equal); if (options == NULL) return -ENOMEM; @@ -88,25 +87,16 @@ static int tc65_enable(struct ofono_modem *modem) if (device == NULL) return -EINVAL; - g_hash_table_insert(options, g_strdup("Baud"), - g_strdup("115200")); - g_hash_table_insert(options, g_strdup("StopBits"), - g_strdup("1")); - g_hash_table_insert(options, g_strdup("DataBits"), - g_strdup("8")); - g_hash_table_insert(options, g_strdup("Parity"), - g_strdup("none")); - g_hash_table_insert(options, g_strdup("XonXoff"), - g_strdup("off")); - g_hash_table_insert(options, g_strdup("RtsCts"), - g_strdup("on")); - g_hash_table_insert(options, g_strdup("Local"), - g_strdup("on")); - g_hash_table_insert(options, g_strdup("Read"), - g_strdup("on")); + g_hash_table_insert(options, "Baud", "115200"); + g_hash_table_insert(options, "StopBits", "1"); + g_hash_table_insert(options, "DataBits", "8"); + g_hash_table_insert(options, "Parity", "none"); + g_hash_table_insert(options, "XonXoff", "off"); + g_hash_table_insert(options, "RtsCts", "on"); + g_hash_table_insert(options, "Local", "on"); + g_hash_table_insert(options, "Read", "on"); channel = g_at_tty_open(device, options); - g_hash_table_destroy(options); if (channel == NULL) -- cgit v1.2.3