summaryrefslogtreecommitdiff
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-09-28 16:22:50 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-09-28 16:22:50 +0300
commita4bb1b593901878f8ab6d551c41772bcaa1b1357 (patch)
tree9ac87b83ab35258d8e3dfdbb0942f6d29249acc0 /src/adapter.c
parentfd9d6c2bbd3517bcf338dad339285672f8332105 (diff)
core: Add proper support for run-time removal of profiles
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 48d6294a..421cd436 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2060,6 +2060,22 @@ void adapter_add_profile(struct btd_adapter *adapter, gpointer p)
g_slist_foreach(adapter->devices, device_probe_profile, profile);
}
+void adapter_remove_profile(struct btd_adapter *adapter, gpointer p)
+{
+ struct btd_profile *profile = p;
+
+ if (!adapter->initialized)
+ return;
+
+ if (profile->device_remove)
+ g_slist_foreach(adapter->devices, device_remove_profile, p);
+
+ adapter->profiles = g_slist_remove(adapter->profiles, profile);
+
+ if (profile->adapter_remove)
+ profile->adapter_remove(profile, adapter);
+}
+
static void load_connections(struct btd_adapter *adapter)
{
GSList *l, *conns;