Date:2012-01-29 20:29:04 (8 years 7 months ago)
Author:Lars C.
Commit:db41fa007dd617807c7f5316b402596fab625f08
Message:ASoC: jz4740-pcm: Fix snd_pcm_hw_constraint_integer error check

snd_pcm_hw_constraint_integer return either 0 or 1 on success, so only treat
negative values as errors.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Files: sound/soc/jz4740/jz4740-pcm.c (1 diff)

Change Details

sound/soc/jz4740/jz4740-pcm.c
213213    if (prtd == NULL)
214214        return -ENOMEM;
215215
216    snd_soc_set_runtime_hwparams(substream, &jz4740_pcm_hardware);
217
216218    ret = snd_pcm_hw_constraint_integer(runtime,
217219            SNDRV_PCM_HW_PARAM_PERIODS);
218    if (ret) {
220    if (ret < 0) {
219221        kfree(prtd);
220222        return ret;
221223    }
222224
223    snd_soc_set_runtime_hwparams(substream, &jz4740_pcm_hardware);
224
225225    runtime->private_data = prtd;
226226
227227    return 0;

Archive Download the corresponding diff file



interactive