card->total_pcm_alloc_bytes + size > max_alloc_per_card)
return -ENOMEM;
- 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");
else
type = SNDRV_DMA_TYPE_DEV_UC;
}
+#endif /* CONFIG_SND_DMA_SGBUF */
err = snd_dma_alloc_pages(type, dev, size, dmab);
if (!err) {