static void load_defaults(struct btd_adapter *adapter)
{
	struct mgmt_tlv_list *list;
	unsigned int err = 0;

	if (!btd_opts.defaults.num_entries ||
	    !btd_has_kernel_features(KERNEL_SET_SYSTEM_CONFIG))
		return;

	list = mgmt_tlv_list_new();

	if (!load_bredr_defaults(adapter, list, &btd_opts.defaults.br))
		goto done;

	if (!load_le_defaults(adapter, list, &btd_opts.defaults.le))
		goto done;

	err = mgmt_send_tlv(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG,
			adapter->dev_id, list, NULL, NULL, NULL);

done:
	if (!err)
		btd_error(adapter->dev_id,
				"Failed to set default system config for hci%u",
				adapter->dev_id);

	mgmt_tlv_list_free(list);
}
static void load_defaults(struct btd_adapter *adapter)
{
	struct mgmt_tlv_list *list;
	unsigned int err = 0;

	if (!btd_opts.defaults.num_entries ||
	    !btd_has_kernel_features(KERNEL_SET_SYSTEM_CONFIG))
		return;

	list = mgmt_tlv_list_new();

	if (!load_bredr_defaults(adapter, list, &btd_opts.defaults.br))
		goto done;

	if (!load_le_defaults(adapter, list, &btd_opts.defaults.le))
		goto done;

	err = mgmt_send_tlv(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG,
			adapter->dev_id, list, NULL, NULL, NULL);

done:
	if (!err)
		btd_error(adapter->dev_id,
				"Failed to set default system config for hci%u",
				adapter->dev_id);

	mgmt_tlv_list_free(list);
}