From: Seppo Ingalsuo Date: Wed, 28 Feb 2024 15:04:33 +0000 (+0200) Subject: topology: nhlt: Intel: Add check for DMIC version X-Git-Tag: v1.2.12~9 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=9efbf459fb6e444859a93562804148833cef3b36;p=alsa-utils.git topology: nhlt: Intel: Add check for DMIC version Error if the version passed from topology is not known. Also fix the dmic_set_params() error prints for to show the correct function name. Closes: https://github.com/alsa-project/alsa-utils/pull/254 Signed-off-by: Seppo Ingalsuo Signed-off-by: Jyri Sarha Signed-off-by: Jaroslav Kysela --- diff --git a/topology/nhlt/intel/dmic/dmic-process.c b/topology/nhlt/intel/dmic/dmic-process.c index facf24f..ead2725 100644 --- a/topology/nhlt/intel/dmic/dmic-process.c +++ b/topology/nhlt/intel/dmic/dmic-process.c @@ -1232,7 +1232,12 @@ int dmic_set_params(struct intel_nhlt_params *nhlt, int dai_index, int driver_ve return -EINVAL; if (dai_index >= DMIC_HW_FIFOS) { - fprintf(stderr, "set_dmic_data illegal dai index\n"); + fprintf(stderr, "%s: illegal dai index %d \n", __func__, dai_index); + return -EINVAL; + } + + if (driver_version < 1 || driver_version > 5) { + fprintf(stderr, "%s: illegal driver version %d\n", __func__, driver_version); return -EINVAL; }