From e0b1b669d36647f659ed1172fada3d31ed1f0424 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 3 Sep 2011 13:41:47 +0800 Subject: [PATCH] --- yaml --- r: 270560 b: refs/heads/master c: 7b4615ba8108649ed30804450eb054925e347ad3 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/sn95031.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 7ef68e170c5c..40c9567b722e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: efd614ac067a30b5541640e89d08f7afa7601f24 +refs/heads/master: 7b4615ba8108649ed30804450eb054925e347ad3 diff --git a/trunk/sound/soc/codecs/sn95031.c b/trunk/sound/soc/codecs/sn95031.c index 84ffdebb8a8b..b4f1cb494ffc 100644 --- a/trunk/sound/soc/codecs/sn95031.c +++ b/trunk/sound/soc/codecs/sn95031.c @@ -79,7 +79,7 @@ static void configure_adc(struct snd_soc_codec *sn95031_codec, int val) */ static int find_free_channel(struct snd_soc_codec *sn95031_codec) { - int ret = 0, i, value; + int i, value; /* check whether ADC is enabled */ value = snd_soc_read(sn95031_codec, SN95031_ADC1CNTL1); @@ -91,12 +91,10 @@ static int find_free_channel(struct snd_soc_codec *sn95031_codec) for (i = 0; i < SN95031_ADC_CHANLS_MAX; i++) { value = snd_soc_read(sn95031_codec, SN95031_ADC_CHNL_START_ADDR + i); - if (value & SN95031_STOPBIT_MASK) { - ret = i; + if (value & SN95031_STOPBIT_MASK) break; - } } - return (ret > SN95031_ADC_LOOP_MAX) ? (-EINVAL) : ret; + return (i == SN95031_ADC_CHANLS_MAX) ? (-EINVAL) : i; } /* Initialize the ADC for reading micbias values. Can sleep. */