@@ -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);
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(-)