Merge branch 'for-2.6.37/misc' of git://git.kernel.dk/linux-2.6-block
[pandora-kernel.git] / arch / um / drivers / harddog_kern.c
index cfcac1f..2d0266d 100644 (file)
@@ -42,7 +42,7 @@
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/reboot.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
@@ -50,6 +50,7 @@
 
 MODULE_LICENSE("GPL");
 
+static DEFINE_MUTEX(harddog_mutex);
 static DEFINE_SPINLOCK(lock);
 static int timer_alive;
 static int harddog_in_fd = -1;
@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
        int err = -EBUSY;
        char *sock = NULL;
 
-       lock_kernel();
+       mutex_lock(&harddog_mutex);
        spin_lock(&lock);
        if(timer_alive)
                goto err;
@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
 
        timer_alive = 1;
        spin_unlock(&lock);
-       unlock_kernel();
+       mutex_unlock(&harddog_mutex);
        return nonseekable_open(inode, file);
 err:
        spin_unlock(&lock);
-       unlock_kernel();
+       mutex_unlock(&harddog_mutex);
        return err;
 }
 
@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
 {
        long ret;
 
-       lock_kernel();
+       mutex_lock(&harddog_mutex);
        ret = harddog_ioctl_unlocked(file, cmd, arg);
-       unlock_kernel();
+       mutex_unlock(&harddog_mutex);
 
        return ret;
 }
@@ -166,6 +167,7 @@ static const struct file_operations harddog_fops = {
        .unlocked_ioctl = harddog_ioctl,
        .open           = harddog_open,
        .release        = harddog_release,
+       .llseek         = no_llseek,
 };
 
 static struct miscdevice harddog_miscdev = {