Commit 8f11551b authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Fix build error without CONFIG_HAS_DMA

The recent change of include/asm-generic/dma-mapping-broken.h breaks
the build without CONFIG_HAS_DMA.  This patch is an ad hoc fix.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent c93d1c25
...@@ -14,7 +14,8 @@ endif ...@@ -14,7 +14,8 @@ endif
snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \ snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
pcm_memory.o pcm_memory.o
snd-page-alloc-objs := memalloc.o sgbuf.o snd-page-alloc-y := memalloc.o
snd-page-alloc-$(CONFIG_HAS_DMA) += sgbuf.o
snd-rawmidi-objs := rawmidi.o snd-rawmidi-objs := rawmidi.o
snd-timer-objs := timer.o snd-timer-objs := timer.o
......
...@@ -206,6 +206,7 @@ void snd_free_pages(void *ptr, size_t size) ...@@ -206,6 +206,7 @@ void snd_free_pages(void *ptr, size_t size)
* *
*/ */
#ifdef CONFIG_HAS_DMA
/* allocate the coherent DMA pages */ /* allocate the coherent DMA pages */
static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma)
{ {
...@@ -239,6 +240,7 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, ...@@ -239,6 +240,7 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr,
dec_snd_pages(pg); dec_snd_pages(pg);
dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma);
} }
#endif /* CONFIG_HAS_DMA */
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
...@@ -312,12 +314,14 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size, ...@@ -312,12 +314,14 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr); dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr);
break; break;
#endif #endif
#ifdef CONFIG_HAS_DMA
case SNDRV_DMA_TYPE_DEV: case SNDRV_DMA_TYPE_DEV:
dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr); dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
break; break;
case SNDRV_DMA_TYPE_DEV_SG: case SNDRV_DMA_TYPE_DEV_SG:
snd_malloc_sgbuf_pages(device, size, dmab, NULL); snd_malloc_sgbuf_pages(device, size, dmab, NULL);
break; break;
#endif
default: default:
printk(KERN_ERR "snd-malloc: invalid device type %d\n", type); printk(KERN_ERR "snd-malloc: invalid device type %d\n", type);
dmab->area = NULL; dmab->area = NULL;
...@@ -383,12 +387,14 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab) ...@@ -383,12 +387,14 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab)
snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
break; break;
#endif #endif
#ifdef CONFIG_HAS_DMA
case SNDRV_DMA_TYPE_DEV: case SNDRV_DMA_TYPE_DEV:
snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
break; break;
case SNDRV_DMA_TYPE_DEV_SG: case SNDRV_DMA_TYPE_DEV_SG:
snd_free_sgbuf_pages(dmab); snd_free_sgbuf_pages(dmab);
break; break;
#endif
default: default:
printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type); printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment