diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-07-26 12:59:36 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:58:05 -0400 |
commit | 8f11551b1798170dcffdd28475075ca4f1c6c990 (patch) | |
tree | c9df0e900e1ebe2f3067555c9decaecefca60920 /sound/core/memalloc.c | |
parent | c93d1c25be410c0378d1d3d9e7efab06bf6a1261 (diff) |
[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: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/memalloc.c')
-rw-r--r-- | sound/core/memalloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 9b5656d8bcca..6f99b6f54870 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c | |||
@@ -206,6 +206,7 @@ void snd_free_pages(void *ptr, size_t size) | |||
206 | * | 206 | * |
207 | */ | 207 | */ |
208 | 208 | ||
209 | #ifdef CONFIG_HAS_DMA | ||
209 | /* allocate the coherent DMA pages */ | 210 | /* allocate the coherent DMA pages */ |
210 | static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) | 211 | static void *snd_malloc_dev_pages(struct device *dev, size_t size, dma_addr_t *dma) |
211 | { | 212 | { |
@@ -239,6 +240,7 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr, | |||
239 | dec_snd_pages(pg); | 240 | dec_snd_pages(pg); |
240 | dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); | 241 | dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); |
241 | } | 242 | } |
243 | #endif /* CONFIG_HAS_DMA */ | ||
242 | 244 | ||
243 | #ifdef CONFIG_SBUS | 245 | #ifdef CONFIG_SBUS |
244 | 246 | ||
@@ -312,12 +314,14 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size, | |||
312 | dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr); | 314 | dmab->area = snd_malloc_sbus_pages(device, size, &dmab->addr); |
313 | break; | 315 | break; |
314 | #endif | 316 | #endif |
317 | #ifdef CONFIG_HAS_DMA | ||
315 | case SNDRV_DMA_TYPE_DEV: | 318 | case SNDRV_DMA_TYPE_DEV: |
316 | dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr); | 319 | dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr); |
317 | break; | 320 | break; |
318 | case SNDRV_DMA_TYPE_DEV_SG: | 321 | case SNDRV_DMA_TYPE_DEV_SG: |
319 | snd_malloc_sgbuf_pages(device, size, dmab, NULL); | 322 | snd_malloc_sgbuf_pages(device, size, dmab, NULL); |
320 | break; | 323 | break; |
324 | #endif | ||
321 | default: | 325 | default: |
322 | printk(KERN_ERR "snd-malloc: invalid device type %d\n", type); | 326 | printk(KERN_ERR "snd-malloc: invalid device type %d\n", type); |
323 | dmab->area = NULL; | 327 | dmab->area = NULL; |
@@ -383,12 +387,14 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab) | |||
383 | snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); | 387 | snd_free_sbus_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); |
384 | break; | 388 | break; |
385 | #endif | 389 | #endif |
390 | #ifdef CONFIG_HAS_DMA | ||
386 | case SNDRV_DMA_TYPE_DEV: | 391 | case SNDRV_DMA_TYPE_DEV: |
387 | snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); | 392 | snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); |
388 | break; | 393 | break; |
389 | case SNDRV_DMA_TYPE_DEV_SG: | 394 | case SNDRV_DMA_TYPE_DEV_SG: |
390 | snd_free_sgbuf_pages(dmab); | 395 | snd_free_sgbuf_pages(dmab); |
391 | break; | 396 | break; |
397 | #endif | ||
392 | default: | 398 | default: |
393 | printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type); | 399 | printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type); |
394 | } | 400 | } |