]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/oss/vwsnd.c
Merge branch 'master' into tk71
[mv-sheeva.git] / sound / oss / vwsnd.c
index 8cd73cdd88afeedbaf90e1bdbab62eb56fc0949e..643f1113b1d8844c4e2850eff613b152aafcb737 100644 (file)
 #include <linux/init.h>
 
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/wait.h>
 #include <linux/interrupt.h>
 #include <linux/mutex.h>
 
 #ifdef VWSND_DEBUG
 
+static DEFINE_MUTEX(vwsnd_mutex);
 static int shut_up = 1;
 
 /*
@@ -2891,11 +2891,11 @@ static long vwsnd_audio_ioctl(struct file *file,
        vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data;
        int ret;
 
-       lock_kernel();
+       mutex_lock(&vwsnd_mutex);
        mutex_lock(&devc->io_mutex);
        ret = vwsnd_audio_do_ioctl(file, cmd, arg);
        mutex_unlock(&devc->io_mutex);
-       unlock_kernel();
+       mutex_unlock(&vwsnd_mutex);
 
        return ret;
 }
@@ -2922,7 +2922,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
 
        DBGE("(inode=0x%p, file=0x%p)\n", inode, file);
 
-       lock_kernel();
+       mutex_lock(&vwsnd_mutex);
        INC_USE_COUNT;
        for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
                if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F))
@@ -2930,7 +2930,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
 
        if (devc == NULL) {
                DEC_USE_COUNT;
-               unlock_kernel();
+               mutex_unlock(&vwsnd_mutex);
                return -ENODEV;
        }
 
@@ -2939,13 +2939,13 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
                mutex_unlock(&devc->open_mutex);
                if (file->f_flags & O_NONBLOCK) {
                        DEC_USE_COUNT;
-                       unlock_kernel();
+                       mutex_unlock(&vwsnd_mutex);
                        return -EBUSY;
                }
                interruptible_sleep_on(&devc->open_wait);
                if (signal_pending(current)) {
                        DEC_USE_COUNT;
-                       unlock_kernel();
+                       mutex_unlock(&vwsnd_mutex);
                        return -ERESTARTSYS;
                }
                mutex_lock(&devc->open_mutex);
@@ -2998,7 +2998,7 @@ static int vwsnd_audio_open(struct inode *inode, struct file *file)
 
        file->private_data = devc;
        DBGRV();
-       unlock_kernel();
+       mutex_unlock(&vwsnd_mutex);
        return 0;
 }
 
@@ -3012,7 +3012,7 @@ static int vwsnd_audio_release(struct inode *inode, struct file *file)
        vwsnd_port_t *wport = NULL, *rport = NULL;
        int err = 0;
 
-       lock_kernel();
+       mutex_lock(&vwsnd_mutex);
        mutex_lock(&devc->io_mutex);
        {
                DBGEV("(inode=0x%p, file=0x%p)\n", inode, file);
@@ -3040,7 +3040,7 @@ static int vwsnd_audio_release(struct inode *inode, struct file *file)
        wake_up(&devc->open_wait);
        DEC_USE_COUNT;
        DBGR();
-       unlock_kernel();
+       mutex_unlock(&vwsnd_mutex);
        return err;
 }
 
@@ -3068,18 +3068,18 @@ static int vwsnd_mixer_open(struct inode *inode, struct file *file)
        DBGEV("(inode=0x%p, file=0x%p)\n", inode, file);
 
        INC_USE_COUNT;
-       lock_kernel();
+       mutex_lock(&vwsnd_mutex);
        for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
                if (devc->mixer_minor == iminor(inode))
                        break;
 
        if (devc == NULL) {
                DEC_USE_COUNT;
-               unlock_kernel();
+               mutex_unlock(&vwsnd_mutex);
                return -ENODEV;
        }
        file->private_data = devc;
-       unlock_kernel();
+       mutex_unlock(&vwsnd_mutex);
        return 0;
 }
 
@@ -3223,7 +3223,7 @@ static long vwsnd_mixer_ioctl(struct file *file,
 
        DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg);
 
-       lock_kernel();
+       mutex_lock(&vwsnd_mutex);
        mutex_lock(&devc->mix_mutex);
        {
                if ((cmd & ~nrmask) == MIXER_READ(0))
@@ -3234,7 +3234,7 @@ static long vwsnd_mixer_ioctl(struct file *file,
                        retval = -EINVAL;
        }
        mutex_unlock(&devc->mix_mutex);
-       unlock_kernel();
+       mutex_unlock(&vwsnd_mutex);
        return retval;
 }