From: Geert Uytterhoeven Date: Sun, 9 Jul 2017 19:31:02 +0000 (+0200) Subject: ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA X-Git-Tag: v4.14-rc4~21^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abe594c2cf55b46d4feb61c01fe9063afff2e50c;p=platform%2Fkernel%2Flinux-rpi3.git ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA 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 Signed-off-by: Takashi Iwai --- diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 0d18343..b26c7e6 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -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,