summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-03-01 17:34:08 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-03-01 17:34:17 +1100
commit9f68614f664506535c873699dcfbca6e2515a24c (patch)
treee4308b68e14e708b3fe58fc7bbf69be1b68a67d5
parent8ce739b235362ca810a5e25fef58e7400ba679b4 (diff)
Restructure streams_seal algorithm, formatting fixes.
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--.vscode/settings.json13
-rw-r--r--configfs.c6
-rw-r--r--core.c22
3 files changed, 22 insertions, 19 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 4dc08b0..0839b43 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,8 +1,9 @@
{
- "editor.tabSize": 8,
- "editor.insertSpaces": false,
- "editor.rulers": [
- 80
- ],
- "editor.formatOnSave": true,
+ "editor.tabSize": 8,
+ "editor.insertSpaces": false,
+ "editor.rulers": [
+ 80
+ ],
+ "editor.formatOnSave": true,
+ "editor.trimAutoWhitespace": true
} \ No newline at end of file
diff --git a/configfs.c b/configfs.c
index 58e523f..5668cb3 100644
--- a/configfs.c
+++ b/configfs.c
@@ -358,8 +358,10 @@ static struct config_item_type cfg_avirt_group_type = {
};
static struct configfs_subsystem cfg_subsys = {
- .su_group = {
- .cg_item = {
+ .su_group =
+ {
+ .cg_item =
+ {
.ci_namebuf = "snd-avirt",
.ci_type = &cfg_avirt_group_type,
},
diff --git a/core.c b/core.c
index e1b056e..a618bfe 100644
--- a/core.c
+++ b/core.c
@@ -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)