Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
[sfrench/cifs-2.6.git] / sound / oss / au1550_ac97.c
index fb913e568de17acf97b083a40b39518ab8f4307b..c6f2621221baeebb428652df9dd51abfb5628b5b 100644 (file)
@@ -50,7 +50,6 @@
 #include <linux/poll.h>
 #include <linux/bitops.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
 #include <linux/mutex.h>
 
@@ -163,19 +162,10 @@ ld2(unsigned int x)
 static void
 au1550_delay(int msec)
 {
-       unsigned long   tmo;
-       signed long     tmo2;
-
        if (in_interrupt())
                return;
 
-       tmo = jiffies + (msec * HZ) / 1000;
-       for (;;) {
-               tmo2 = tmo - jiffies;
-               if (tmo2 <= 0)
-                       break;
-               schedule_timeout(tmo2);
-       }
+       schedule_timeout_uninterruptible(msecs_to_jiffies(msec));
 }
 
 static u16
@@ -827,22 +817,26 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
        return codec->mixer_ioctl(codec, cmd, arg);
 }
 
-static int
-au1550_ioctl_mixdev(struct inode *inode, struct file *file,
-                              unsigned int cmd, unsigned long arg)
+static long
+au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct au1550_state *s = (struct au1550_state *)file->private_data;
        struct ac97_codec *codec = s->codec;
+       int ret;
+
+       lock_kernel();
+       ret = mixdev_ioctl(codec, cmd, arg);
+       unlock_kernel();
 
-       return mixdev_ioctl(codec, cmd, arg);
+       return ret;
 }
 
 static /*const */ struct file_operations au1550_mixer_fops = {
-       owner:THIS_MODULE,
-       llseek:au1550_llseek,
-       ioctl:au1550_ioctl_mixdev,
-       open:au1550_open_mixdev,
-       release:au1550_release_mixdev,
+       .owner          = THIS_MODULE,
+       .llseek         = au1550_llseek,
+       .unlocked_ioctl = au1550_ioctl_mixdev,
+       .open           = au1550_open_mixdev,
+       .release        = au1550_release_mixdev,
 };
 
 static int
@@ -1346,8 +1340,7 @@ dma_count_done(struct dmabuf *db)
 
 
 static int
-au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                                                       unsigned long arg)
+au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct au1550_state *s = (struct au1550_state *)file->private_data;
        unsigned long   flags;
@@ -1783,6 +1776,17 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        return mixdev_ioctl(s->codec, cmd, arg);
 }
 
+static long
+au1550_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+       int ret;
+
+       lock_kernel();
+       ret = au1550_ioctl(file, cmd, arg);
+       unlock_kernel();
+
+       return ret;
+}
 
 static int
 au1550_open(struct inode *inode, struct file *file)
@@ -1893,15 +1897,15 @@ au1550_release(struct inode *inode, struct file *file)
 }
 
 static /*const */ struct file_operations au1550_audio_fops = {
-       owner:          THIS_MODULE,
-       llseek:         au1550_llseek,
-       read:           au1550_read,
-       write:          au1550_write,
-       poll:           au1550_poll,
-       ioctl:          au1550_ioctl,
-       mmap:           au1550_mmap,
-       open:           au1550_open,
-       release:        au1550_release,
+       .owner          = THIS_MODULE,
+       .llseek         = au1550_llseek,
+       .read           = au1550_read,
+       .write          = au1550_write,
+       .poll           = au1550_poll,
+       .unlocked_ioctl = au1550_unlocked_ioctl,
+       .mmap           = au1550_mmap,
+       .open           = au1550_open,
+       .release        = au1550_release,
 };
 
 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");