summaryrefslogtreecommitdiffstats
path: root/plugins/sap.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-09-28 14:13:58 -0300
committerDenis Kenzior <denkenz@gmail.com>2011-09-28 02:24:36 -0500
commit02a6d7b3a9037c2ad407d95ad54e2477f68e4c4d (patch)
treeb07d5004f34ba599058f931173a11d483fb84676 /plugins/sap.c
parent4f54a1853987ddd564ee6c8b35f6f2c529fb6a00 (diff)
downloadofono-02a6d7b3a9037c2ad407d95ad54e2477f68e4c4d.tar.bz2
sap: clean up sap modem destruction
Diffstat (limited to 'plugins/sap.c')
-rw-r--r--plugins/sap.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/sap.c b/plugins/sap.c
index 4579d8f3b..1c0d9ce4 100644
--- a/plugins/sap.c
+++ b/plugins/sap.c
@@ -70,16 +70,6 @@ int bluetooth_sap_client_register(struct bluetooth_sap_driver *sap,
return 0;
}
-static void sap_remove_modem(struct ofono_modem *modem)
-{
- struct sap_data *data = ofono_modem_get_data(modem);
-
- g_free(data);
-
- ofono_modem_set_data(modem, NULL);
-
- ofono_modem_remove(modem);
-}
void bluetooth_sap_client_unregister(struct ofono_modem *modem)
{
@@ -93,7 +83,8 @@ void bluetooth_sap_client_unregister(struct ofono_modem *modem)
while (g_hash_table_iter_next(&iter, &key, &value)) {
g_hash_table_iter_remove(&iter);
- sap_remove_modem(value);
+
+ ofono_modem_remove(value);
}
sap_hw_modem = NULL;
@@ -117,7 +108,13 @@ static int sap_probe(struct ofono_modem *modem)
static void sap_remove(struct ofono_modem *modem)
{
+ struct sap_data *data = ofono_modem_get_data(modem);
+
DBG("%p", modem);
+
+ g_free(data);
+
+ ofono_modem_set_data(modem, NULL);
}
static void sap_connect_reply(DBusPendingCall *call, gpointer user_data)
@@ -235,7 +232,8 @@ static void bluetooth_sap_remove(const char *prefix)
continue;
g_hash_table_iter_remove(&iter);
- sap_remove_modem(value);
+
+ ofono_modem_remove(value);
}
}