]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: propagate nhlt plugin error to main program
authorChao Song <chao.song@linux.intel.com>
Thu, 8 Dec 2022 06:40:04 +0000 (14:40 +0800)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 Jan 2023 18:02:23 +0000 (19:02 +0100)
Let's propagate nhlt plugin error to main program,
so that we don't generate a wrong nhlt blob silently.

Fixes: https://github.com/alsa-project/alsa-utils/pull/181
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/nhlt/intel/ssp/ssp-process.c
topology/pre-processor.c

index 39e95e5a32a27727134a4c9521f1fc21b5ec0e6a..657b9d97f3d2bef60d7cbf33cfde29e7838c75aa 100644 (file)
@@ -521,7 +521,8 @@ int ssp_calculate(struct intel_nhlt_params *nhlt)
 
        /* calculate blob for every hw config */
        for (i = 0; i < ssp->ssp_hw_config_count[ssp->ssp_count]; i++)
-               ssp_calculate_intern(nhlt, i);
+               if (ssp_calculate_intern(nhlt, i) < 0)
+                       return -EINVAL;
 
        ssp_print_internal(ssp);
        ssp_print_calculated(ssp);
index c5b260c8f5abaa1b2e57459887e7076e145b666d..dfe3ad62bd1d5326136b206af842159e12f9200f 100644 (file)
@@ -98,7 +98,7 @@ static int run_plugin(struct tplg_pre_processor *tplg_pp, char *plugin)
        }
 
        /* process plugin */
-       process(tplg_pp->input_cfg, tplg_pp->output_cfg);
+       ret = process(tplg_pp->input_cfg, tplg_pp->output_cfg);
 
 err:
        if (h)
@@ -689,7 +689,7 @@ int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_
        /* process topology plugins */
        err = pre_process_plugins(tplg_pp);
        if (err < 0) {
-               fprintf(stderr, "Unable to run pre-process plugins\n");
+               fprintf(stderr, "Unable to run pre-process plugins or plugins return error\n");
                goto err;
        }