From ee92c647c5db72f390e19c9f41701773f322785a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 31 May 2019 11:26:15 -0500 Subject: [PATCH] speedup: Use at_util_open_device --- plugins/speedup.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/plugins/speedup.c b/plugins/speedup.c index d1ea35a1..0b5d2289 100644 --- a/plugins/speedup.c +++ b/plugins/speedup.c @@ -109,34 +109,7 @@ static void speedup_debug(const char *str, void *user_data) static GAtChat *open_device(struct ofono_modem *modem, const char *key, char *debug) { - const char *device; - GIOChannel *channel; - GAtSyntax *syntax; - GAtChat *chat; - - device = ofono_modem_get_string(modem, key); - if (device == NULL) - return NULL; - - DBG("%s %s", key, device); - - channel = g_at_tty_open(device, NULL); - if (channel == NULL) - return NULL; - - syntax = g_at_syntax_new_gsm_permissive(); - chat = g_at_chat_new(channel, syntax); - g_at_syntax_unref(syntax); - - g_io_channel_unref(channel); - - if (chat == NULL) - return NULL; - - if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(chat, speedup_debug, debug); - - return chat; + return at_util_open_device(modem, key, speedup_debug, debug, NULL); } static void sim_state_cb(gboolean present, gpointer user_data)