Skip to content

Commit

Permalink
Input: serio_raw - remove BKL
Browse files Browse the repository at this point in the history
serio_raw open function already uses a mutex. Also change formatting
a bit.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Dmitry Torokhov committed Mar 10, 2010
1 parent c90c6a8 commit 77554b4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/input/serio/serio_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ static int serio_raw_open(struct inode *inode, struct file *file)
struct serio_raw_list *list;
int retval = 0;

lock_kernel();
retval = mutex_lock_interruptible(&serio_raw_mutex);
if (retval)
goto out_bkl;
return retval;

if (!(serio_raw = serio_raw_locate(iminor(inode)))) {
serio_raw = serio_raw_locate(iminor(inode));
if (!serio_raw) {
retval = -ENODEV;
goto out;
}
Expand All @@ -96,7 +96,8 @@ static int serio_raw_open(struct inode *inode, struct file *file)
goto out;
}

if (!(list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL))) {
list = kzalloc(sizeof(struct serio_raw_list), GFP_KERNEL);
if (!list) {
retval = -ENOMEM;
goto out;
}
Expand All @@ -109,8 +110,6 @@ static int serio_raw_open(struct inode *inode, struct file *file)

out:
mutex_unlock(&serio_raw_mutex);
out_bkl:
unlock_kernel();
return retval;
}

Expand Down

0 comments on commit 77554b4

Please sign in to comment.