linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / sound / pci / emu10k1 / emufx.c
index dfba002..5098372 100644 (file)
@@ -32,8 +32,6 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
-#include <linux/mutex.h>
-
 #include <sound/core.h>
 #include <sound/emu10k1.h>
 
@@ -876,7 +874,7 @@ static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
 {
        int err = 0;
 
-       mutex_lock(&emu->fx8010.lock);
+       down(&emu->fx8010.lock);
        if ((err = snd_emu10k1_verify_controls(emu, icode)) < 0)
                goto __error;
        strlcpy(emu->fx8010.name, icode->name, sizeof(emu->fx8010.name));
@@ -899,7 +897,7 @@ static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
        else
                snd_emu10k1_ptr_write(emu, DBG, 0, emu->fx8010.dbg);
       __error:
-       mutex_unlock(&emu->fx8010.lock);
+       up(&emu->fx8010.lock);
        return err;
 }
 
@@ -908,7 +906,7 @@ static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu,
 {
        int err;
 
-       mutex_lock(&emu->fx8010.lock);
+       down(&emu->fx8010.lock);
        strlcpy(icode->name, emu->fx8010.name, sizeof(icode->name));
        /* ok, do the main job */
        err = snd_emu10k1_gpr_peek(emu, icode);
@@ -918,7 +916,7 @@ static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu,
                err = snd_emu10k1_code_peek(emu, icode);
        if (err >= 0)
                err = snd_emu10k1_list_controls(emu, icode);
-       mutex_unlock(&emu->fx8010.lock);
+       up(&emu->fx8010.lock);
        return err;
 }
 
@@ -934,7 +932,7 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
        if (ipcm->channels > 32)
                return -EINVAL;
        pcm = &emu->fx8010.pcm[ipcm->substream];
-       mutex_lock(&emu->fx8010.lock);
+       down(&emu->fx8010.lock);
        spin_lock_irq(&emu->reg_lock);
        if (pcm->opened) {
                err = -EBUSY;
@@ -964,7 +962,7 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
        }
       __error:
        spin_unlock_irq(&emu->reg_lock);
-       mutex_unlock(&emu->fx8010.lock);
+       up(&emu->fx8010.lock);
        return err;
 }
 
@@ -978,7 +976,7 @@ static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,
        if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
                return -EINVAL;
        pcm = &emu->fx8010.pcm[ipcm->substream];
-       mutex_lock(&emu->fx8010.lock);
+       down(&emu->fx8010.lock);
        spin_lock_irq(&emu->reg_lock);
        ipcm->channels = pcm->channels;
        ipcm->tram_start = pcm->tram_start;
@@ -994,7 +992,7 @@ static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,
        ipcm->res1 = ipcm->res2 = 0;
        ipcm->pad = 0;
        spin_unlock_irq(&emu->reg_lock);
-       mutex_unlock(&emu->fx8010.lock);
+       up(&emu->fx8010.lock);
        return err;
 }
 
@@ -2310,9 +2308,9 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
                        return -EPERM;
                if (get_user(addr, (unsigned int __user *)argp))
                        return -EFAULT;
-               mutex_lock(&emu->fx8010.lock);
+               down(&emu->fx8010.lock);
                res = snd_emu10k1_fx8010_tram_setup(emu, addr);
-               mutex_unlock(&emu->fx8010.lock);
+               up(&emu->fx8010.lock);
                return res;
        case SNDRV_EMU10K1_IOCTL_STOP:
                if (!capable(CAP_SYS_ADMIN))