diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2019-03-01 17:34:08 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2019-03-05 10:33:28 +1100 |
commit | 8c7cba43618d1aca05cad1e10ea238a082e313ee (patch) | |
tree | d09bb84b93b8f7c968a54226852a133af0d8ef35 /core.c | |
parent | da4c2a5619c60cd4dab733bb23a33ed373c78c77 (diff) |
Restructure streams_seal algorithm, formatting fixes.
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core.c')
-rw-r--r-- | core.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -187,9 +187,7 @@ struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid) { struct snd_avirt_audiopath_obj *ap_obj; - list_for_each_entry(ap_obj, &audiopath_list, list) { - //D_INFOK("snd_avirt_audiopath_get, map:%s", uid); - + list_for_each_entry (ap_obj, &audiopath_list, list) { if (!strcmp(ap_obj->path->uid, uid)) return ap_obj->path; } @@ -339,16 +337,18 @@ int snd_avirt_streams_seal(void) return -1; } - list_for_each_entry(ap_obj, &audiopath_list, list) { + list_for_each_entry (ap_obj, &audiopath_list, list) { for (i = 0; i < MAX_STREAMS; i++) stream_array.streams[i] = NULL; stream_array.count = 0; - if (snd_avirt_streams_get(ap_obj->path->uid, &stream_array) > - 0) { - D_INFOK("Do configure for AP: %s streams:%d", - ap_obj->path->uid, stream_array.count); - ap_obj->path->configure(core.card, &stream_array); - } + if (snd_avirt_streams_get(ap_obj->path->uid, &stream_array) <= + 0) + continue; + + D_INFOK("Do configure for AP: %s streams:%d cb:%p", + ap_obj->path->uid, stream_array.count, + ap_obj->path->configure); + ap_obj->path->configure(core.card, &stream_array); } core.streams_sealed = true; @@ -372,7 +372,7 @@ struct snd_avirt_stream *snd_avirt_stream_find_by_device(unsigned int device) return ERR_PTR(-EINVAL); } - list_for_each(entry, &core.stream_group->cg_children) { + list_for_each (entry, &core.stream_group->cg_children) { item = container_of(entry, struct config_item, ci_entry); stream = snd_avirt_stream_from_config_item(item); if (!stream) |