From 040f5acd0778e5e254496aab60fd74d8232a5654 Mon Sep 17 00:00:00 2001 From: Rudi Date: Sun, 9 Aug 2015 16:34:20 +0200 Subject: [PATCH] sound: fsl_hdmi: Fix return value handling when setting constraints. Some of the snd_pcm_hw_constraint_xxx() functions may return non-zero positive values in case of success. So in order to detect errors we should check for negatives. Signed-off-by: Rudi --- sound/soc/fsl/fsl_hdmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_hdmi.c b/sound/soc/fsl/fsl_hdmi.c index 3385221edca7e3..3d0280ade10602 100644 --- a/sound/soc/fsl/fsl_hdmi.c +++ b/sound/soc/fsl/fsl_hdmi.c @@ -348,23 +348,23 @@ static int fsl_hdmi_update_constraints(struct snd_pcm_substream *substream) fsl_hdmi_get_playback_rates(); ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &playback_constraint_rates); - if (ret) + if (ret < 0) return ret; fsl_hdmi_get_playback_sample_size(); ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, &playback_constraint_bits); - if (ret) + if (ret < 0) return ret; fsl_hdmi_get_playback_channels(); ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &playback_constraint_channels); - if (ret) + if (ret < 0) return ret; ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); - if (ret) + if (ret < 0) return ret; return 0;