struct ctl_dev *ctl_dev;
snd_ctl_card_info_t *info;
const char *id;
- int err, card, ucm_group, ucm_offset;
+ int err, card, ucm_group, ucm_offset, found;
snd_ctl_card_info_alloca(&info);
ctl_list = list_entry(pos1, struct ctl_list, list);
if (ctl_list->ucm_group != ucm_group)
continue;
- if (strcmp(id, snd_ctl_card_info_get_id(ctl_list->ctl_info)) == 0) {
- card = snd_card_get_index(id);
- err = uc_mgr_ctl_add(uc_mgr, &ctl_list, ctl, card, info, device + ucm_offset, slave);
- if (err < 0)
- goto __nomem;
- snd_ctl_close(ctl);
- ctl_list->ucm_group = ucm_group;
- *ctll = ctl_list;
- return 0;
+ if (strcmp(id, snd_ctl_card_info_get_id(ctl_list->ctl_info)) != 0)
+ continue;
+ found = 0;
+ list_for_each(pos2, &ctl_list->dev_list) {
+ ctl_dev = list_entry(pos2, struct ctl_dev, list);
+ if (uc_mgr_ctl_dev_name_eq(ctl_dev->device, device + ucm_offset)) {
+ found = 1;
+ break;
+ }
}
+ if (!found)
+ continue;
+ card = snd_card_get_index(id);
+ err = uc_mgr_ctl_add(uc_mgr, &ctl_list, ctl, card, info, device + ucm_offset, slave);
+ if (err < 0)
+ goto __nomem;
+ snd_ctl_close(ctl);
+ ctl_list->ucm_group = ucm_group;
+ *ctll = ctl_list;
+ return 0;
}
ctl_list = NULL;