summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-07-07 13:12:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-30 16:27:26 +0200
commit52a7c86e63d22aea3057542c3b2d9ff262472af6 (patch)
tree01e50858feec1a6dba140846a652938997f04189 /sound
parenta1ef12540ebd3f5774a9740f58fc483752798a5b (diff)
ALSA: pcm: Fix build error on m68k and others
commit 467fd0e82b6265b8e6cc078a70bd7592574d5c83 upstream. The commit 3ad796cbc36a ("ALSA: pcm: Use SG-buffer only when direct DMA is available") introduced a check of the DMA type and this caused a build error on m68k (and possibly some others) due to the lack of dma_is_direct() definition. Since the check is needed only for CONFIG_SND_DMA_SGBUF enablement (i.e. solely x86), use #ifdef instead of IS_ENABLED() for avoiding such a build error. Fixes: 3ad796cbc36a ("ALSA: pcm: Use SG-buffer only when direct DMA is available") Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20200707111225.26826-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_memory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index beca39f7c8f3..22055bb2eba2 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -66,8 +66,9 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev,
__update_allocated_size(card, size);
mutex_unlock(&card->memory_mutex);
- if (IS_ENABLED(CONFIG_SND_DMA_SGBUF) &&
- (type == SNDRV_DMA_TYPE_DEV_SG || type == SNDRV_DMA_TYPE_DEV_UC_SG) &&
+
+#ifdef CONFIG_SND_DMA_SGBUF
+ if ((type == SNDRV_DMA_TYPE_DEV_SG || type == SNDRV_DMA_TYPE_DEV_UC_SG) &&
!dma_is_direct(get_dma_ops(dev))) {
/* mutate to continuous page allocation */
dev_dbg(dev, "Use continuous page allocator\n");
@@ -76,6 +77,7 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev,
else
type = SNDRV_DMA_TYPE_DEV_UC;
}
+#endif /* CONFIG_SND_DMA_SGBUF */
err = snd_dma_alloc_pages(type, dev, size, dmab);
if (!err) {