{
struct tplg_ref *ref;
struct list_head *base, *pos;
- int err = 0;
+ int err;
base = &elem->ref_list;
SNDERR("error: cannot find '%s' referenced by"
" control '%s'\n", ref->id, elem->id);
return -EINVAL;
- } else if (err < 0)
- return err;
+ }
}
return 0;
list_for_each(pos, base) {
ref = list_entry(pos, struct tplg_ref, list);
- if (ref->id == NULL || ref->elem)
+ if (ref->elem)
continue;
if (ref->type == SND_TPLG_TYPE_DATA) {
int err;
err = tplg_build_stream_caps(tplg, elem->id, elem->pcm->caps);
- if (err < 0)
- return err;
+ if (err < 0)
+ return err;
/* merge private data from the referenced data elements */
base = &elem->ref_list;
SNDERR("error: cannot find '%s' referenced by"
" PCM '%s'\n", ref->id, elem->id);
return -EINVAL;
- } else if (err < 0)
- return err;
+ }
}
return 0;
/* ID and names */
link->id = link_tpl->id;
- if (link->name)
- elem_copy_text(link->name, link_tpl->name,
- SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- if (link->stream_name)
- elem_copy_text(link->stream_name, link_tpl->stream_name,
- SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
+ elem_copy_text(link->name, link_tpl->name,
+ SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
+ elem_copy_text(link->stream_name, link_tpl->stream_name,
+ SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
/* stream configs */
if (link_tpl->num_streams > SND_SOC_TPLG_STREAM_CONFIG_MAX)