diff options
author | Fuwei Tang <fuweix.tang@intel.com> | 2017-04-13 14:52:45 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-04-21 12:56:08 +0200 |
commit | af231ea1db393da5bab07f609d1a8be8936791fd (patch) | |
tree | af4c7cbc9c3375649b68f7c63a1cfb3a53f440ef | |
parent | dfd5ebd33f334e1176583c7e1255bb01a5c49d15 (diff) |
topology: Remove code parsing index value in paring each object
We insert a new element into the object list based on its index value, so we parse
index value in "tplg_elem_new_common" before insert it, and then remove code
parsing index value in parsing each object.
Signed-off-by: Fuwei Tang <fuweix.tang@intel.com>
Reviewed-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/topology/ctl.c | 27 | ||||
-rw-r--r-- | src/topology/dapm.c | 9 | ||||
-rw-r--r-- | src/topology/data.c | 9 | ||||
-rw-r--r-- | src/topology/pcm.c | 36 |
4 files changed, 0 insertions, 81 deletions
diff --git a/src/topology/ctl.c b/src/topology/ctl.c index c026c2a9..cba98f12 100644 --- a/src/topology/ctl.c +++ b/src/topology/ctl.c @@ -396,15 +396,6 @@ int tplg_parse_control_bytes(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "base") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; @@ -537,15 +528,6 @@ int tplg_parse_control_enum(snd_tplg_t *tplg, snd_config_t *cfg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "texts") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; @@ -647,15 +629,6 @@ int tplg_parse_control_mixer(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "channel") == 0) { if (mc->num_channels >= SND_SOC_TPLG_MAX_CHAN) { SNDERR("error: too many channels %s\n", diff --git a/src/topology/dapm.c b/src/topology/dapm.c index eef72bbf..ba5d9fea 100644 --- a/src/topology/dapm.c +++ b/src/topology/dapm.c @@ -483,15 +483,6 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "type") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; diff --git a/src/topology/data.c b/src/topology/data.c index 31e4ee12..01e2bd16 100644 --- a/src/topology/data.c +++ b/src/topology/data.c @@ -1009,15 +1009,6 @@ int tplg_parse_data(snd_tplg_t *tplg, snd_config_t *cfg, continue; } - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "type") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; diff --git a/src/topology/pcm.c b/src/topology/pcm.c index 50a373a6..b5e63782 100644 --- a/src/topology/pcm.c +++ b/src/topology/pcm.c @@ -553,15 +553,6 @@ int tplg_parse_pcm(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "id") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; @@ -653,15 +644,6 @@ int tplg_parse_dai(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "id") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; @@ -803,15 +785,6 @@ int tplg_parse_link(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "id") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; @@ -917,15 +890,6 @@ int tplg_parse_cc(snd_tplg_t *tplg, if (id[0] == '#') continue; - if (strcmp(id, "index") == 0) { - if (snd_config_get_string(n, &val) < 0) - return -EINVAL; - - elem->index = atoi(val); - tplg_dbg("\t%s: %d\n", id, elem->index); - continue; - } - if (strcmp(id, "id") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; |