summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-12-15 15:17:47 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2011-12-15 16:06:28 +0100
commit363712f5fbe72d383458543f7957882db47b33cb (patch)
tree7b44b64a8373126db5b89aad9314fc1fbb3fc044 /plugins
parent9a035b26d71263043e60e5d10ef1f24dbc86a3e5 (diff)
downloadconnman-363712f5fbe72d383458543f7957882db47b33cb.tar.gz
connman-363712f5fbe72d383458543f7957882db47b33cb.tar.bz2
connman-363712f5fbe72d383458543f7957882db47b33cb.zip
ofono: Cleanup connection_manager_init()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 153ef2d2..86f57d74 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1526,27 +1526,31 @@ static int cdma_cm_get_properties(struct modem_data *modem)
return -EINVAL;
}
-static gboolean connection_managers_init(struct modem_data *modem)
+static int connection_manager_init(struct modem_data *modem)
{
if (has_interface(modem->interfaces, OFONO_API_CM) == TRUE) {
if (ready_to_create_device(modem) == TRUE)
create_device(modem);
+
if (modem->device != NULL) {
cm_get_properties(modem);
cm_get_contexts(modem);
}
- return TRUE;
- } else if (has_interface(modem->interfaces,
- OFONO_API_CDMA_CM) == TRUE) {
+ return 0;
+ }
+
+ if (has_interface(modem->interfaces, OFONO_API_CDMA_CM) == TRUE) {
if (ready_to_create_device(modem) == TRUE)
create_device(modem);
+
if (modem->device != NULL)
cdma_cm_get_properties(modem);
- return TRUE;
- } else
- return FALSE;
+ return 0;
+ }
+
+ return 0;
}
static void update_sim_imsi(struct modem_data *modem,
@@ -1634,7 +1638,7 @@ static void sim_properties_reply(struct modem_data *modem,
break;
}
- connection_managers_init(modem);
+ connection_manager_init(modem);
return;
}
@@ -1687,7 +1691,7 @@ static gboolean modem_changed(DBusConnection *connection, DBusMessage *message,
if (modem->online == FALSE)
return TRUE;
- connection_managers_init(modem);
+ connection_manager_init(modem);
} else if (g_str_equal(key, "Interfaces") == TRUE) {
modem->interfaces = extract_interfaces(&value);
@@ -1706,7 +1710,7 @@ static gboolean modem_changed(DBusConnection *connection, DBusMessage *message,
}
}
- if (connection_managers_init(modem) == FALSE) {
+ if (connection_manager_init(modem) == FALSE) {
if (modem->context != NULL) {
remove_cm_context(modem,
modem->context->path);
@@ -1734,7 +1738,7 @@ static gboolean modem_changed(DBusConnection *connection, DBusMessage *message,
DBG("%s Serial %s", modem->path, modem->serial);
- connection_managers_init(modem);
+ connection_manager_init(modem);
}
return TRUE;
@@ -1817,7 +1821,7 @@ static void add_modem(const char *path, DBusMessageIter *prop)
} else if (has_interface(modem->interfaces, OFONO_API_SIM) == TRUE) {
sim_get_properties(modem);
} else
- connection_managers_init(modem);
+ connection_manager_init(modem);
}
static void modem_power_down(gpointer key, gpointer value, gpointer user_data)