[S390] monwriter: 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 <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
1963403aae
commit
801f97b7da
1 changed files with 4 additions and 3 deletions
|
@ -13,7 +13,6 @@
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/smp_lock.h>
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/miscdevice.h>
|
#include <linux/miscdevice.h>
|
||||||
|
@ -185,13 +184,11 @@ static int monwrite_open(struct inode *inode, struct file *filp)
|
||||||
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
|
monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
|
||||||
if (!monpriv)
|
if (!monpriv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
lock_kernel();
|
|
||||||
INIT_LIST_HEAD(&monpriv->list);
|
INIT_LIST_HEAD(&monpriv->list);
|
||||||
monpriv->hdr_to_read = sizeof(monpriv->hdr);
|
monpriv->hdr_to_read = sizeof(monpriv->hdr);
|
||||||
mutex_init(&monpriv->thread_mutex);
|
mutex_init(&monpriv->thread_mutex);
|
||||||
filp->private_data = monpriv;
|
filp->private_data = monpriv;
|
||||||
list_add_tail(&monpriv->priv_list, &mon_priv_list);
|
list_add_tail(&monpriv->priv_list, &mon_priv_list);
|
||||||
unlock_kernel();
|
|
||||||
return nonseekable_open(inode, filp);
|
return nonseekable_open(inode, filp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,6 +361,10 @@ static int __init mon_init(void)
|
||||||
goto out_driver;
|
goto out_driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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)
|
if (rc)
|
||||||
goto out_device;
|
goto out_device;
|
||||||
|
|
Loading…
Add table
Reference in a new issue