static void discovery_remove(struct discovery_client *client)
{
	struct btd_adapter *adapter = client->adapter;

	DBG("owner %s", client->owner);

	adapter->set_filter_list = g_slist_remove(adapter->set_filter_list,
								client);

	adapter->discovery_list = g_slist_remove(adapter->discovery_list,
								client);

	if (adapter->client == client)
		adapter->client = NULL;

	if (client->watch && client->discovery_filter)
		adapter->set_filter_list = g_slist_prepend(
					adapter->set_filter_list, client);
	else
		discovery_free(client);

	/*
	 * If there are other client discoveries in progress, then leave
	 * it active. If not, then make sure to stop the restart timeout.
	 */
	if (adapter->discovery_list)
		return;

	discovery_cleanup(adapter, TEMP_DEV_TIMEOUT);
}
static void discovery_remove(struct discovery_client *client)
{
	struct btd_adapter *adapter = client->adapter;

	DBG("owner %s", client->owner);

	adapter->set_filter_list = g_slist_remove(adapter->set_filter_list,
								client);

	adapter->discovery_list = g_slist_remove(adapter->discovery_list,
								client);

	if (adapter->client == client)
		adapter->client = NULL;

	if (client->watch && client->discovery_filter)
		adapter->set_filter_list = g_slist_prepend(
					adapter->set_filter_list, client);
	else
		discovery_free(client);

	 
	if (adapter->discovery_list)
		return;

	discovery_cleanup(adapter, TEMP_DEV_TIMEOUT);
}