summaryrefslogtreecommitdiffstats
path: root/sound/core/memalloc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-24 14:25:32 +0200
committerTakashi Iwai <tiwai@suse.de>2013-10-24 14:36:40 +0200
commita5606f85611267047206d8ba055bc0e4ba166ad3 (patch)
treee7ddca0bee0ce3ffb002afb3f4715f49a9573214 /sound/core/memalloc.c
parent95f74c41b2e53f541f2f66c8ba3dac1601ebd409 (diff)
downloadtalos-obmc-linux-a5606f85611267047206d8ba055bc0e4ba166ad3.tar.gz
talos-obmc-linux-a5606f85611267047206d8ba055bc0e4ba166ad3.zip
ALSA: Add ifdef CONFIG_GENERIC_ALLOCATOR for SNDRV_DMA_TYPE_IRAM code
It turned out that we can't use gen_pool_*() functions on archs without CONFIG_GENERIC_ALLOCATOR (resulting in missing symbols), since linux/genalloc.h doesn't provide dummy functions for all. We'd be able to fix linux/genalloc.h size, but I take an easier path for now... Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/memalloc.c')
-rw-r--r--sound/core/memalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 18c1d4759ccb..51a79218815b 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -238,6 +238,7 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
dmab->addr = 0;
break;
#ifdef CONFIG_HAS_DMA
+#ifdef CONFIG_GENERIC_ALLOCATOR
case SNDRV_DMA_TYPE_DEV_IRAM:
snd_malloc_dev_iram(dmab, size);
if (dmab->area)
@@ -246,6 +247,7 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
* so if we fail to malloc, try to fetch memory traditionally.
*/
dmab->dev.type = SNDRV_DMA_TYPE_DEV;
+#endif /* CONFIG_GENERIC_ALLOCATOR */
case SNDRV_DMA_TYPE_DEV:
dmab->area = snd_malloc_dev_pages(device, size, &dmab->addr);
break;
@@ -318,9 +320,11 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab)
snd_free_pages(dmab->area, dmab->bytes);
break;
#ifdef CONFIG_HAS_DMA
+#ifdef CONFIG_GENERIC_ALLOCATOR
case SNDRV_DMA_TYPE_DEV_IRAM:
snd_free_dev_iram(dmab);
break;
+#endif /* CONFIG_GENERIC_ALLOCATOR */
case SNDRV_DMA_TYPE_DEV:
snd_free_dev_pages(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
break;
OpenPOWER on IntegriCloud