topology: propagate nhlt plugin error to main program

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>
This commit is contained in:
Chao Song 2022-12-08 14:40:04 +08:00 committed by Jaroslav Kysela
parent 8871d51aa1
commit deaa1635cc
2 changed files with 4 additions and 3 deletions

View file

@ -521,7 +521,8 @@ int ssp_calculate(struct intel_nhlt_params *nhlt)
/* calculate blob for every hw config */ /* calculate blob for every hw config */
for (i = 0; i < ssp->ssp_hw_config_count[ssp->ssp_count]; i++) 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_internal(ssp);
ssp_print_calculated(ssp); ssp_print_calculated(ssp);

View file

@ -98,7 +98,7 @@ static int run_plugin(struct tplg_pre_processor *tplg_pp, char *plugin)
} }
/* process plugin */ /* process plugin */
process(tplg_pp->input_cfg, tplg_pp->output_cfg); ret = process(tplg_pp->input_cfg, tplg_pp->output_cfg);
err: err:
if (h) if (h)
@ -689,7 +689,7 @@ int pre_process(struct tplg_pre_processor *tplg_pp, char *config, size_t config_
/* process topology plugins */ /* process topology plugins */
err = pre_process_plugins(tplg_pp); err = pre_process_plugins(tplg_pp);
if (err < 0) { 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; goto err;
} }