dmaengine/dma_slave: introduce inline wrappers
[linux-2.6.git] / sound / core / memalloc.c
index a7b46ec..16bd9c0 100644 (file)
@@ -33,9 +33,6 @@
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
 #include <sound/memalloc.h>
-#ifdef CONFIG_SBUS
-#include <asm/sbus.h>
-#endif
 
 
 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>");
@@ -162,39 +159,6 @@ static void snd_free_dev_pages(struct device *dev, size_t size, void *ptr,
 }
 #endif /* CONFIG_HAS_DMA */
 
-#ifdef CONFIG_SBUS
-
-static void *snd_malloc_sbus_pages(struct device *dev, size_t size,
-                                  dma_addr_t *dma_addr)
-{
-       struct sbus_dev *sdev = (struct sbus_dev *)dev;
-       int pg;
-       void *res;
-
-       if (WARN_ON(!dma_addr))
-               return NULL;
-       pg = get_order(size);
-       res = sbus_alloc_consistent(sdev, PAGE_SIZE * (1 << pg), dma_addr);
-       if (res != NULL)
-               inc_snd_pages(pg);
-       return res;
-}
-
-static void snd_free_sbus_pages(struct device *dev, size_t size,
-                               void *ptr, dma_addr_t dma_addr)
-{
-       struct sbus_dev *sdev = (struct sbus_dev *)dev;
-       int pg;
-
-       if (ptr == NULL)
-               return;
-       pg = get_order(size);
-       dec_snd_pages(pg);
-       sbus_free_consistent(sdev, PAGE_SIZE * (1 << pg), ptr, dma_addr);
-}
-
-#endif /* CONFIG_SBUS */
-
 /*
  *
  *  ALSA generic memory management
@@ -228,18 +192,16 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
        dmab->bytes = 0;
        switch (type) {
        case SNDRV_DMA_TYPE_CONTINUOUS:
-               dmab->area = snd_malloc_pages(size, (unsigned long)device);
+               dmab->area = snd_malloc_pages(size,
+                                       (__force gfp_t)(unsigned long)device);
                dmab->addr = 0;
                break;
-#ifdef CONFIG_SBUS
-       case SNDRV_DMA_TYPE_SBUS:
-               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;
+#endif
+#ifdef CONFIG_SND_DMA_SGBUF
        case SNDRV_DMA_TYPE_DEV_SG:
                snd_malloc_sgbuf_pages(device, size, dmab, NULL);
                break;
@@ -306,15 +268,12 @@ void snd_dma_free_pages(struct snd_dma_buffer *dmab)
        case SNDRV_DMA_TYPE_CONTINUOUS:
                snd_free_pages(dmab->area, dmab->bytes);
                break;
-#ifdef CONFIG_SBUS
-       case SNDRV_DMA_TYPE_SBUS:
-               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;
+#endif
+#ifdef CONFIG_SND_DMA_SGBUF
        case SNDRV_DMA_TYPE_DEV_SG:
                snd_free_sgbuf_pages(dmab);
                break;
@@ -419,7 +378,7 @@ static int snd_mem_proc_read(struct seq_file *seq, void *offset)
        long pages = snd_allocated_pages >> (PAGE_SHIFT-12);
        struct snd_mem_list *mem;
        int devno;
-       static char *types[] = { "UNKNOWN", "CONT", "DEV", "DEV-SG", "SBUS" };
+       static char *types[] = { "UNKNOWN", "CONT", "DEV", "DEV-SG" };
 
        mutex_lock(&list_mutex);
        seq_printf(seq, "pages  : %li bytes (%li pages per %likB)\n",