X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fchar%2Fds1620.c;h=aab9605f0b43291974c67855caf920c5656c8b0d;hb=e55a4046dab28c440c96890bdddcf02dc8981f2d;hp=dbee8688f75ceafddfd80a5be5b7dcf8affd7140;hpb=b74b953b998bcc2db91b694446f3a2619ec32de6;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index dbee8688f75c..aab9605f0b43 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include @@ -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 = {