Skip to content

Commit

Permalink
ALSA: pcm: Simplify check for dma_mmap_coherent() availability
Browse files Browse the repository at this point in the history
We check the availability of dma_mmap_coherent() in hw_support_mmap()
but with an ugly ifdef of lots of arch-checks.  Now we have a nice
CONFIG_ARCH_NO_COHERENT_DMA_MMAP kconfig, and this can be used
together with CONFIG_HAS_DMA check for a cleaner and more
comprehensive check.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jul 10, 2017
1 parent abe594c commit 85dc0f8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
{
if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_MMAP))
return false;
/* check architectures that return -EINVAL from dma_mmap_coherent() */
/* FIXME: this should be some global flag */
#if defined(CONFIG_C6X) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) ||\
defined(CONFIG_PARISC) || defined(CONFIG_XTENSA)
/* architecture supports dma_mmap_coherent()? */
#if defined(CONFIG_ARCH_NO_COHERENT_DMA_MMAP) || !defined(CONFIG_HAS_DMA)
if (!substream->ops->mmap &&
substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
return false;
Expand Down

0 comments on commit 85dc0f8

Please sign in to comment.