summaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/sof_maxim_common.c
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2023-11-27 18:26:30 +0300
committerMark Brown <broonie@kernel.org>2023-11-27 19:32:50 +0300
commit007d9a638b877f71a0ef28a906525904e44f6aa2 (patch)
tree5c85a87b7e2db85aae1281a8969605fae31af3a2 /sound/soc/intel/boards/sof_maxim_common.c
parent06dea47be6d3d0ad3ef5f7c9dd0947d1c825e0ff (diff)
downloadlinux-007d9a638b877f71a0ef28a906525904e44f6aa2.tar.xz
ASoC: Intel: sof_maxim_common: check return value
snd_soc_dai_set_tdm_slot() could return error. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20231127152654.28204-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/sof_maxim_common.c')
-rw-r--r--sound/soc/intel/boards/sof_maxim_common.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c
index f64124077ca7..cf2974718271 100644
--- a/sound/soc/intel/boards/sof_maxim_common.c
+++ b/sound/soc/intel/boards/sof_maxim_common.c
@@ -61,15 +61,21 @@ static int max_98373_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *codec_dai;
+ int ret = 0;
int j;
for_each_rtd_codec_dais(rtd, j, codec_dai) {
if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
/* DEV0 tdm slot configuration */
- snd_soc_dai_set_tdm_slot(codec_dai, 0x03, 3, 8, 32);
+ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x03, 3, 8, 32);
} else if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
/* DEV1 tdm slot configuration */
- snd_soc_dai_set_tdm_slot(codec_dai, 0x0C, 3, 8, 32);
+ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x0C, 3, 8, 32);
+ }
+ if (ret < 0) {
+ dev_err(codec_dai->dev, "fail to set tdm slot, ret %d\n",
+ ret);
+ return ret;
}
}
return 0;