X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fcore%2Fmemalloc.c;h=920e5780c2284c9c086dd1bfaf02aff5462786d2;hb=8d3c202be23c5a915f7053ebd4e96f44700c6a62;hp=9b5656d8bccac7d140168bfbd1e65af4a0e96c13;hpb=ccec6e2c4a74adf76ed4e2478091a311b1806212;p=karo-tx-linux.git diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 9b5656d8bcca..920e5780c228 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) by Jaroslav Kysela + * Copyright (c) by Jaroslav Kysela * Takashi Iwai * * Generic memory allocators @@ -38,7 +38,7 @@ #endif -MODULE_AUTHOR("Takashi Iwai , Jaroslav Kysela "); +MODULE_AUTHOR("Takashi Iwai , Jaroslav Kysela "); MODULE_DESCRIPTION("Memory allocator for ALSA system."); MODULE_LICENSE("GPL"); @@ -206,6 +206,7 @@ void snd_free_pages(void *ptr, size_t size) * */ +#ifdef CONFIG_HAS_DMA /* allocate the coherent DMA pages */ 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, dec_snd_pages(pg); dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); } +#endif /* CONFIG_HAS_DMA */ #ifdef CONFIG_SBUS @@ -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); break; #endif +#ifdef CONFIG_HAS_DMA case SNDRV_DMA_TYPE_DEV: dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr); break; case SNDRV_DMA_TYPE_DEV_SG: snd_malloc_sgbuf_pages(device, size, dmab, NULL); break; +#endif default: printk(KERN_ERR "snd-malloc: invalid device type %d\n", type); dmab->area = NULL; @@ -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); break; #endif +#ifdef CONFIG_HAS_DMA case SNDRV_DMA_TYPE_DEV: snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr); break; case SNDRV_DMA_TYPE_DEV_SG: snd_free_sgbuf_pages(dmab); break; +#endif default: printk(KERN_ERR "snd-malloc: invalid device type %d\n", dmab->dev.type); } @@ -562,6 +568,7 @@ static ssize_t snd_mem_proc_write(struct file *file, const char __user * buffer, if (pci_set_dma_mask(pci, mask) < 0 || pci_set_consistent_dma_mask(pci, mask) < 0) { printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device); + pci_dev_put(pci); return count; } }