aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-01-11 04:24:44 -0500
committerMark Brown <broonie@linaro.org>2014-01-14 15:42:34 -0500
commit55dcdb5051930dee75e9e2c0da90bc82ee3dcd77 (patch)
treee05838d0923ffce632897b46954468349a661c7a
parente3a9269f874067fcefc5eb8037466161fb0fe3f4 (diff)
ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper
Instead of open-coding the intersecting of two rate masks (and getting slightly wrong for some of the corner cases) use the new snd_pcm_rate_mask_intersect() helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/soc-pcm.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2b8949647e32..4bbda0a4ee03 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -162,13 +162,8 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
162 hw->formats &= codec_stream->formats & cpu_stream->formats; 162 hw->formats &= codec_stream->formats & cpu_stream->formats;
163 else 163 else
164 hw->formats = codec_stream->formats & cpu_stream->formats; 164 hw->formats = codec_stream->formats & cpu_stream->formats;
165 hw->rates = codec_stream->rates & cpu_stream->rates; 165 hw->rates = snd_pcm_rate_mask_intersect(codec_stream->rates,
166 if (codec_stream->rates 166 cpu_stream->rates);
167 & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
168 hw->rates |= cpu_stream->rates;
169 if (cpu_stream->rates
170 & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
171 hw->rates |= codec_stream->rates;
172 167
173 hw->rate_min = 0; 168 hw->rate_min = 0;
174 hw->rate_max = UINT_MAX; 169 hw->rate_max = UINT_MAX;