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-01 17:34:17 +1100 |
commit | 9f68614f664506535c873699dcfbca6e2515a24c (patch) | |
tree | e4308b68e14e708b3fe58fc7bbf69be1b68a67d5 /core.c | |
parent | 8ce739b235362ca810a5e25fef58e7400ba679b4 (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) |