void adapter_connect_list_remove(struct btd_adapter *adapter,
					struct btd_device *device)
{
	/*
	 * If the adapter->connect_le device is being removed from the
	 * connect list it means the connection was successful and hence
	 * the pointer should be cleared
	 */
	if (device == adapter->connect_le)
		adapter->connect_le = NULL;

	if (btd_has_kernel_features(KERNEL_CONN_CONTROL))
		return;

	if (!g_slist_find(adapter->connect_list, device)) {
		DBG("device %s is not on the list, ignoring",
						device_get_path(device));
		return;
	}

	adapter->connect_list = g_slist_remove(adapter->connect_list, device);
	DBG("%s removed from %s's connect_list", device_get_path(device),
							adapter->system_name);

	if (!adapter->connect_list) {
		stop_passive_scanning(adapter);
		return;
	}

	if (!btd_adapter_get_powered(adapter))
		return;

	trigger_passive_scanning(adapter);
}
void adapter_connect_list_remove(struct btd_adapter *adapter,
					struct btd_device *device)
{
	 
	if (device == adapter->connect_le)
		adapter->connect_le = NULL;

	if (btd_has_kernel_features(KERNEL_CONN_CONTROL))
		return;

	if (!g_slist_find(adapter->connect_list, device)) {
		DBG("device %s is not on the list, ignoring",
						device_get_path(device));
		return;
	}

	adapter->connect_list = g_slist_remove(adapter->connect_list, device);
	DBG("%s removed from %s's connect_list", device_get_path(device),
							adapter->system_name);

	if (!adapter->connect_list) {
		stop_passive_scanning(adapter);
		return;
	}

	if (!btd_adapter_get_powered(adapter))
		return;

	trigger_passive_scanning(adapter);
}