Skip to content

Commit 55dcdb5

Browse files
larsclausenbroonie
authored andcommitted
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>
1 parent e3a9269 commit 55dcdb5

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎sound/soc/soc-pcm.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,8 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_runtime *runtime,
162162
hw->formats &= codec_stream->formats & cpu_stream->formats;
163163
else
164164
hw->formats = codec_stream->formats & cpu_stream->formats;
165-
hw->rates = codec_stream->rates & cpu_stream->rates;
166-
if (codec_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;
165+
hw->rates = snd_pcm_rate_mask_intersect(codec_stream->rates,
166+
cpu_stream->rates);
172167

173168
hw->rate_min = 0;
174169
hw->rate_max = UINT_MAX;

0 commit comments

Comments
 (0)