]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - sound/oss/dmasound/dmasound_core.c
sound/oss: convert to unlocked_ioctl
[net-next-2.6.git] / sound / oss / dmasound / dmasound_core.c
index 5a4f38c0f480659a028dbb0533e8ec049afde9c9..6ecd41abb0667fbdfc580c51fb134fcae9fa46f8 100644 (file)
@@ -341,8 +341,8 @@ static int mixer_release(struct inode *inode, struct file *file)
        unlock_kernel();
        return 0;
 }
-static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
-                      u_long arg)
+
+static int mixer_ioctl(struct file *file, u_int cmd, u_long arg)
 {
        if (_SIOC_DIR(cmd) & _SIOC_WRITE)
            mixer.modify_counter++;
@@ -366,11 +366,22 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
        return -EINVAL;
 }
 
+static long mixer_unlocked_ioctl(struct file *file, u_int cmd, u_long arg)
+{
+       int ret;
+
+       lock_kernel();
+       ret = mixer_ioctl(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 static const struct file_operations mixer_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
-       .ioctl          = mixer_ioctl,
+       .unlocked_ioctl = mixer_unlocked_ioctl,
        .open           = mixer_open,
        .release        = mixer_release,
 };
@@ -963,8 +974,7 @@ printk("dmasound_core: tried to set_queue_frags on a locked queue\n") ;
        return 0 ;
 }
 
-static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
-                   u_long arg)
+static int sq_ioctl(struct file *file, u_int cmd, u_long arg)
 {
        int val, result;
        u_long fmt;
@@ -1122,18 +1132,29 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
                return IOCTL_OUT(arg,val);
 
        default:
-               return mixer_ioctl(inode, file, cmd, arg);
+               return mixer_ioctl(file, cmd, arg);
        }
        return -EINVAL;
 }
 
+static long sq_unlocked_ioctl(struct file *file, u_int cmd, u_long arg)
+{
+       int ret;
+
+       lock_kernel();
+       ret = sq_ioctl(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
+
 static const struct file_operations sq_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = sq_write,
        .poll           = sq_poll,
-       .ioctl          = sq_ioctl,
+       .unlocked_ioctl = sq_unlocked_ioctl,
        .open           = sq_open,
        .release        = sq_release,
 };