]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/isdn/hardware/eicon/divamnt.c
Merge branch 'linus' into core/softlockup
[mirror_ubuntu-hirsute-kernel.git] / drivers / isdn / hardware / eicon / divamnt.c
index 77155d9f399bc1d1b46c2323ac4f6bedb48b30db..1e85f743214e3507a03eabd05a829539d86e300d 100644 (file)
@@ -13,9 +13,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/smp_lock.h>
 #include <linux/poll.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 
 #include "platform.h"
@@ -129,14 +128,19 @@ static unsigned int maint_poll(struct file *file, poll_table * wait)
 
 static int maint_open(struct inode *ino, struct file *filep)
 {
+       int ret;
+
+       lock_kernel();
        /* only one open is allowed, so we test
           it atomically */
        if (test_and_set_bit(0, &opened))
-               return (-EBUSY);
-
-       filep->private_data = NULL;
-
-       return nonseekable_open(ino, filep);
+               ret = -EBUSY;
+       else {
+               filep->private_data = NULL;
+               ret = nonseekable_open(ino, filep);
+       }
+       unlock_kernel();
+       return ret;
 }
 
 static int maint_close(struct inode *ino, struct file *filep)
@@ -164,7 +168,7 @@ static ssize_t divas_maint_read(struct file *file, char __user *buf,
        return (maint_read_write(buf, (int) count));
 }
 
-static struct file_operations divas_maint_fops = {
+static const struct file_operations divas_maint_fops = {
        .owner   = THIS_MODULE,
        .llseek  = no_llseek,
        .read    = divas_maint_read,