]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/ds1620.c
Merge tag 'v2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / char / ds1620.c
index dbee8688f75ceafddfd80a5be5b7dcf8affd7140..aab9605f0b43291974c67855caf920c5656c8b0d 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/proc_fs.h>
 #include <linux/capability.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -34,6 +34,7 @@
 #define CFG_CPU                        2
 #define CFG_1SHOT              1
 
+static DEFINE_MUTEX(ds1620_mutex);
 static const char *fan_state[] = { "off", "on", "on (hardwired)" };
 
 /*
@@ -210,7 +211,6 @@ static void ds1620_read_state(struct therm *therm)
 
 static int ds1620_open(struct inode *inode, struct file *file)
 {
-       cycle_kernel_lock();
        return nonseekable_open(inode, file);
 }
 
@@ -321,9 +321,9 @@ ds1620_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        int ret;
 
-       lock_kernel();
+       mutex_lock(&ds1620_mutex);
        ret = ds1620_ioctl(file, cmd, arg);
-       unlock_kernel();
+       mutex_unlock(&ds1620_mutex);
 
        return ret;
 }
@@ -357,6 +357,7 @@ static const struct file_operations ds1620_fops = {
        .open           = ds1620_open,
        .read           = ds1620_read,
        .unlocked_ioctl = ds1620_unlocked_ioctl,
+       .llseek         = no_llseek,
 };
 
 static struct miscdevice ds1620_miscdev = {