From: Gerald Schaefer Date: Mon, 7 Dec 2009 11:52:17 +0000 (+0100) Subject: [S390] monreader: remove lock_kernel() from open() function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1963403aae0fc5a4e20cf2e51e4f0148fdf938b4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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: Gerald Schaefer Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index 66e21dd2315..60473f86e1f 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -283,7 +282,6 @@ static int mon_open(struct inode *inode, struct file *filp) /* * only one user allowed */ - lock_kernel(); rc = -EBUSY; if (test_and_set_bit(MON_IN_USE, &mon_in_use)) goto out; @@ -321,7 +319,6 @@ static int mon_open(struct inode *inode, struct file *filp) } filp->private_data = monpriv; dev_set_drvdata(monreader_device, monpriv); - unlock_kernel(); return nonseekable_open(inode, filp); out_path: @@ -331,7 +328,6 @@ out_priv: out_use: clear_bit(MON_IN_USE, &mon_in_use); out: - unlock_kernel(); return rc; } @@ -607,6 +603,10 @@ static int __init mon_init(void) } 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); if (rc < 0 ) goto out;