diff options
author | John Kacur <jkacur@redhat.com> | 2009-10-18 17:49:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-04 15:31:20 -0500 |
commit | 6432e734c99ed685e3cad72f7dcae4c65008fcab (patch) | |
tree | 2d654c52446e6619eed42648977aeb0181e0d98e /drivers/char | |
parent | a87da40875f5510866a699b72818cce09b0b9040 (diff) |
sony_pi: Remove the BKL from open and ioctl
The BKL is in this function because of the BKL pushdown (see commit
f8f2c79d594463427f7114cedb1555110d547d89)
It is not needed here because the mutex_lock sonypi_device.lock provides
the necessary locking.
sonypi_misc_ioctl can be converted to unlocked ioctls since it relies on
its own locking (the mutex sonypi_device.lock) and not the bkl
Document that llseek is not needed by explictly setting it to no_llseek
LKML-Reference: <alpine.LFD.2.00.0910192019420.3563@localhost.localdomain>
Signed-off-by: John Kacur <jkacur@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/sonypi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 0798754a607c..bba727c3807e 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -50,7 +50,6 @@ | |||
50 | #include <linux/err.h> | 50 | #include <linux/err.h> |
51 | #include <linux/kfifo.h> | 51 | #include <linux/kfifo.h> |
52 | #include <linux/platform_device.h> | 52 | #include <linux/platform_device.h> |
53 | #include <linux/smp_lock.h> | ||
54 | 53 | ||
55 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
56 | #include <asm/io.h> | 55 | #include <asm/io.h> |
@@ -905,14 +904,13 @@ static int sonypi_misc_release(struct inode *inode, struct file *file) | |||
905 | 904 | ||
906 | static int sonypi_misc_open(struct inode *inode, struct file *file) | 905 | static int sonypi_misc_open(struct inode *inode, struct file *file) |
907 | { | 906 | { |
908 | lock_kernel(); | ||
909 | mutex_lock(&sonypi_device.lock); | 907 | mutex_lock(&sonypi_device.lock); |
910 | /* Flush input queue on first open */ | 908 | /* Flush input queue on first open */ |
911 | if (!sonypi_device.open_count) | 909 | if (!sonypi_device.open_count) |
912 | kfifo_reset(&sonypi_device.fifo); | 910 | kfifo_reset(&sonypi_device.fifo); |
913 | sonypi_device.open_count++; | 911 | sonypi_device.open_count++; |
914 | mutex_unlock(&sonypi_device.lock); | 912 | mutex_unlock(&sonypi_device.lock); |
915 | unlock_kernel(); | 913 | |
916 | return 0; | 914 | return 0; |
917 | } | 915 | } |
918 | 916 | ||
@@ -955,10 +953,10 @@ static unsigned int sonypi_misc_poll(struct file *file, poll_table *wait) | |||
955 | return 0; | 953 | return 0; |
956 | } | 954 | } |
957 | 955 | ||
958 | static int sonypi_misc_ioctl(struct inode *ip, struct file *fp, | 956 | static long sonypi_misc_ioctl(struct file *fp, |
959 | unsigned int cmd, unsigned long arg) | 957 | unsigned int cmd, unsigned long arg) |
960 | { | 958 | { |
961 | int ret = 0; | 959 | long ret = 0; |
962 | void __user *argp = (void __user *)arg; | 960 | void __user *argp = (void __user *)arg; |
963 | u8 val8; | 961 | u8 val8; |
964 | u16 val16; | 962 | u16 val16; |
@@ -1074,7 +1072,8 @@ static const struct file_operations sonypi_misc_fops = { | |||
1074 | .open = sonypi_misc_open, | 1072 | .open = sonypi_misc_open, |
1075 | .release = sonypi_misc_release, | 1073 | .release = sonypi_misc_release, |
1076 | .fasync = sonypi_misc_fasync, | 1074 | .fasync = sonypi_misc_fasync, |
1077 | .ioctl = sonypi_misc_ioctl, | 1075 | .unlocked_ioctl = sonypi_misc_ioctl, |
1076 | .llseek = no_llseek, | ||
1078 | }; | 1077 | }; |
1079 | 1078 | ||
1080 | static struct miscdevice sonypi_misc_device = { | 1079 | static struct miscdevice sonypi_misc_device = { |