Commit 1963403a authored by Gerald Schaefer's avatar Gerald Schaefer Committed by Martin Schwidefsky

[S390] monreader: remove lock_kernel() from open() function

The lock_kernel() calls in the open() function are unnecessary because
misc_register() is called last in module_init() and concurrent open()
calls are handled by other means.
Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 2da3cf97
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -283,7 +282,6 @@ static int mon_open(struct inode *inode, struct file *filp) ...@@ -283,7 +282,6 @@ static int mon_open(struct inode *inode, struct file *filp)
/* /*
* only one user allowed * only one user allowed
*/ */
lock_kernel();
rc = -EBUSY; rc = -EBUSY;
if (test_and_set_bit(MON_IN_USE, &mon_in_use)) if (test_and_set_bit(MON_IN_USE, &mon_in_use))
goto out; goto out;
...@@ -321,7 +319,6 @@ static int mon_open(struct inode *inode, struct file *filp) ...@@ -321,7 +319,6 @@ static int mon_open(struct inode *inode, struct file *filp)
} }
filp->private_data = monpriv; filp->private_data = monpriv;
dev_set_drvdata(monreader_device, monpriv); dev_set_drvdata(monreader_device, monpriv);
unlock_kernel();
return nonseekable_open(inode, filp); return nonseekable_open(inode, filp);
out_path: out_path:
...@@ -331,7 +328,6 @@ static int mon_open(struct inode *inode, struct file *filp) ...@@ -331,7 +328,6 @@ static int mon_open(struct inode *inode, struct file *filp)
out_use: out_use:
clear_bit(MON_IN_USE, &mon_in_use); clear_bit(MON_IN_USE, &mon_in_use);
out: out:
unlock_kernel();
return rc; return rc;
} }
...@@ -607,6 +603,10 @@ static int __init mon_init(void) ...@@ -607,6 +603,10 @@ static int __init mon_init(void)
} }
dcss_mkname(mon_dcss_name, &user_data_connect[8]); dcss_mkname(mon_dcss_name, &user_data_connect[8]);
/*
* misc_register() has to be the last action in module_init(), because
* file operations will be available right after this.
*/
rc = misc_register(&mon_dev); rc = misc_register(&mon_dev);
if (rc < 0 ) if (rc < 0 )
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment