linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / sound / pci / emu10k1 / memory.c
index 4fcaefe..68c795c 100644 (file)
@@ -24,8 +24,6 @@
 #include <sound/driver.h>
 #include <linux/pci.h>
 #include <linux/time.h>
-#include <linux/mutex.h>
-
 #include <sound/core.h>
 #include <sound/emu10k1.h>
 
@@ -287,8 +285,6 @@ int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *b
        return err;
 }
 
-EXPORT_SYMBOL(snd_emu10k1_memblk_map);
-
 /*
  * page allocation for DMA
  */
@@ -306,10 +302,10 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
        hdr = emu->memhdr;
        snd_assert(hdr, return NULL);
 
-       mutex_lock(&hdr->block_mutex);
+       down(&hdr->block_mutex);
        blk = search_empty(emu, runtime->dma_bytes);
        if (blk == NULL) {
-               mutex_unlock(&hdr->block_mutex);
+               up(&hdr->block_mutex);
                return NULL;
        }
        /* fill buffer addresses but pointers are not stored so that
@@ -322,14 +318,14 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
                if (idx >= sgbuf->pages) {
                        printk(KERN_ERR "emu: pages overflow! (%d-%d) for %d\n",
                               blk->first_page, blk->last_page, sgbuf->pages);
-                       mutex_unlock(&hdr->block_mutex);
+                       up(&hdr->block_mutex);
                        return NULL;
                }
 #endif
                addr = sgbuf->table[idx].addr;
                if (! is_valid_page(emu, addr)) {
                        printk(KERN_ERR "emu: failure page = %d\n", idx);
-                       mutex_unlock(&hdr->block_mutex);
+                       up(&hdr->block_mutex);
                        return NULL;
                }
                emu->page_addr_table[page] = addr;
@@ -341,10 +337,10 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
        err = snd_emu10k1_memblk_map(emu, blk);
        if (err < 0) {
                __snd_util_mem_free(hdr, (struct snd_util_memblk *)blk);
-               mutex_unlock(&hdr->block_mutex);
+               up(&hdr->block_mutex);
                return NULL;
        }
-       mutex_unlock(&hdr->block_mutex);
+       up(&hdr->block_mutex);
        return (struct snd_util_memblk *)blk;
 }
 
@@ -373,23 +369,22 @@ snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
        struct snd_emu10k1_memblk *blk;
        struct snd_util_memhdr *hdr = hw->memhdr; 
 
-       mutex_lock(&hdr->block_mutex);
+       down(&hdr->block_mutex);
        blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size);
        if (blk == NULL) {
-               mutex_unlock(&hdr->block_mutex);
+               up(&hdr->block_mutex);
                return NULL;
        }
        if (synth_alloc_pages(hw, blk)) {
                __snd_util_mem_free(hdr, (struct snd_util_memblk *)blk);
-               mutex_unlock(&hdr->block_mutex);
+               up(&hdr->block_mutex);
                return NULL;
        }
        snd_emu10k1_memblk_map(hw, blk);
-       mutex_unlock(&hdr->block_mutex);
+       up(&hdr->block_mutex);
        return (struct snd_util_memblk *)blk;
 }
 
-EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
 
 /*
  * free a synth sample area
@@ -401,18 +396,17 @@ snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
        struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk;
        unsigned long flags;
 
-       mutex_lock(&hdr->block_mutex);
+       down(&hdr->block_mutex);
        spin_lock_irqsave(&emu->memblk_lock, flags);
        if (blk->mapped_page >= 0)
                unmap_memblk(emu, blk);
        spin_unlock_irqrestore(&emu->memblk_lock, flags);
        synth_free_pages(emu, blk);
         __snd_util_mem_free(hdr, memblk);
-       mutex_unlock(&hdr->block_mutex);
+       up(&hdr->block_mutex);
        return 0;
 }
 
-EXPORT_SYMBOL(snd_emu10k1_synth_free);
 
 /* check new allocation range */
 static void get_single_page_range(struct snd_util_memhdr *hdr,
@@ -544,8 +538,6 @@ int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk
        return 0;
 }
 
-EXPORT_SYMBOL(snd_emu10k1_synth_bzero);
-
 /*
  * copy_from_user(blk + offset, data, size)
  */
@@ -574,5 +566,3 @@ int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_me
        } while (offset < end_offset);
        return 0;
 }
-
-EXPORT_SYMBOL(snd_emu10k1_synth_copy_from_user);