ASoC: Don't tell applications about msbits unless we're ignoring input
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 19 Jan 2012 18:04:18 +0000 (18:04 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 21 Jan 2012 21:15:37 +0000 (21:15 +0000)
On the off chance that an application both pays attention and gets
confused.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-pcm.c

index 8bb17937d59a3a0807c19e506c3a2335b3890421..326890148a26e8cfc893fb47604ac57f16f8d2f2 100644 (file)
@@ -85,9 +85,11 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream,
                return;
 
        for (i = 0; i < ARRAY_SIZE(sample_sizes); i++) {
-               ret = snd_pcm_hw_constraint_msbits(substream->runtime,
-                                                  0, sample_sizes[i],
-                                                  bits);
+               if (bits >= sample_sizes[i])
+                       continue;
+
+               ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0,
+                                                  sample_sizes[i], bits);
                if (ret != 0)
                        dev_warn(dai->dev,
                                 "Failed to set MSB %d/%d: %d\n",