Skip to content

Commit

Permalink
Input: mousedev - remove BKL
Browse files Browse the repository at this point in the history
There's no need for BKL in mousedev, relevan protection is provided by
a private mutex.

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 3dd1b39 commit c90c6a8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/input/mousedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/module.h>
#include <linux/init.h>
Expand Down Expand Up @@ -542,10 +541,8 @@ static int mousedev_open(struct inode *inode, struct file *file)
if (i >= MOUSEDEV_MINORS)
return -ENODEV;

lock_kernel();
error = mutex_lock_interruptible(&mousedev_table_mutex);
if (error) {
unlock_kernel();
return error;
}
mousedev = mousedev_table[i];
Expand All @@ -554,7 +551,6 @@ static int mousedev_open(struct inode *inode, struct file *file)
mutex_unlock(&mousedev_table_mutex);

if (!mousedev) {
unlock_kernel();
return -ENODEV;
}

Expand All @@ -575,15 +571,13 @@ static int mousedev_open(struct inode *inode, struct file *file)
goto err_free_client;

file->private_data = client;
unlock_kernel();
return 0;

err_free_client:
mousedev_detach_client(mousedev, client);
kfree(client);
err_put_mousedev:
put_device(&mousedev->dev);
unlock_kernel();
return error;
}

Expand Down

0 comments on commit c90c6a8

Please sign in to comment.