Skip to content

Commit

Permalink
ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA
Browse files Browse the repository at this point in the history
If NO_DMA=y:

    sound/core/pcm_native.o: In function `snd_pcm_lib_default_mmap':
    pcm_native.c:(.text+0x144c): undefined reference to `bad_dma_ops'
    pcm_native.c:(.text+0x1474): undefined reference to `dma_common_mmap'

Add a check for HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
geertu authored and tiwai committed Jul 10, 2017
1 parent 20e2b79 commit abe594c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -3502,7 +3502,7 @@ int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
}
#endif /* CONFIG_GENERIC_ALLOCATOR */
#ifndef CONFIG_X86 /* for avoiding warnings arch/x86/mm/pat.c */
if (!substream->ops->page &&
if (IS_ENABLED(CONFIG_HAS_DMA) && !substream->ops->page &&
substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
return dma_mmap_coherent(substream->dma_buffer.dev.dev,
area,
Expand Down

0 comments on commit abe594c

Please sign in to comment.