[PATCH] ASoC: loongson: Add error handling in loongson_pcm_open
This patch adds error-handling for the snd_pcm_hw_constraint_step() and snd_pcm_hw_constrain_integer() inside the img_prl_out_hw_params function in the loongson_dma.c file.
Signed-off-by: liuhaoran liuhaoran14@163.com --- sound/soc/loongson/loongson_dma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c index 47d6551903fc..af9e6a881a2a 100644 --- a/sound/soc/loongson/loongson_dma.c +++ b/sound/soc/loongson/loongson_dma.c @@ -240,17 +240,17 @@ static int loongson_pcm_open(struct snd_soc_component *component,
ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128); - if (ret<0) + if (ret < 0) return ret;
- error = snd_pcm_hw_constraint_step(runtime, 0, + ret = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 128); - if (ret<0) + if (ret < 0) return ret; - error = snd_pcm_hw_constraint_integer(substream->runtime, + ret = snd_pcm_hw_constraint_integer(substream->runtime, SNDRV_PCM_HW_PARAM_PERIODS); - if (ret<0) + if (ret < 0) return ret;
snd_soc_set_runtime_hwparams(substream, &ls_pcm_hardware);
participants (1)
-
liuhaoran