Skip to content

Commit

Permalink
ASoC: pcm: Use snd_pcm_rate_mask_intersect() helper
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
larsclausen authored and broonie committed Jan 14, 2014
1 parent e3a9269 commit 55dcdb5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,8 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
hw->formats &= codec_stream->formats & cpu_stream->formats;
else
hw->formats = codec_stream->formats & cpu_stream->formats;
hw->rates = codec_stream->rates & cpu_stream->rates;
if (codec_stream->rates
& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
hw->rates |= cpu_stream->rates;
if (cpu_stream->rates
& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
hw->rates |= codec_stream->rates;
hw->rates = snd_pcm_rate_mask_intersect(codec_stream->rates,
cpu_stream->rates);

hw->rate_min = 0;
hw->rate_max = UINT_MAX;
Expand Down

0 comments on commit 55dcdb5

Please sign in to comment.