]> git.alsa-project.org Git - alsa-utils.git/commitdiff
pre-process-object: skip parent update if parent is NULL
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Sun, 13 Jun 2021 03:27:19 +0000 (20:27 -0700)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 Aug 2021 14:49:56 +0000 (16:49 +0200)
Nothing to do for top-level objects with no parent.
Also, add access to the bytes control template.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-object.c

index b527b225ac6f998272e555baec0c2460b0ab9210..e4769464cab72e5495f40de02c0c145745e186e9 100644 (file)
@@ -87,6 +87,10 @@ int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent,
        char *item_id;
        int ret, id = 0;
 
+       /* Nothing to do if parent is NULL */
+       if (!parent)
+               return 0;
+
        child = tplg_object_get_instance_config(tplg_pp, parent);
        ret = snd_config_search(child, "name", &cfg);
        if (ret < 0) {
@@ -963,6 +967,7 @@ const struct config_template_items mixer_control_config = {
 
 const struct config_template_items bytes_control_config = {
        .int_config_ids = {"index", "base", "num_regs", "max", "mask"},
+       .compound_config_ids = {"access"}
 };
 
 const struct config_template_items scale_config = {