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>

authored by

John Kacur and committed by
Linus Torvalds
6432e734 a87da408

+5 -6
+5 -6
drivers/char/sonypi.c
··· 50 #include <linux/err.h> 51 #include <linux/kfifo.h> 52 #include <linux/platform_device.h> 53 - #include <linux/smp_lock.h> 54 55 #include <asm/uaccess.h> 56 #include <asm/io.h> ··· 904 905 static int sonypi_misc_open(struct inode *inode, struct file *file) 906 { 907 - lock_kernel(); 908 mutex_lock(&sonypi_device.lock); 909 /* Flush input queue on first open */ 910 if (!sonypi_device.open_count) 911 kfifo_reset(&sonypi_device.fifo); 912 sonypi_device.open_count++; 913 mutex_unlock(&sonypi_device.lock); 914 - unlock_kernel(); 915 return 0; 916 } 917 ··· 953 return 0; 954 } 955 956 - static int sonypi_misc_ioctl(struct inode *ip, struct file *fp, 957 unsigned int cmd, unsigned long arg) 958 { 959 - int ret = 0; 960 void __user *argp = (void __user *)arg; 961 u8 val8; 962 u16 val16; ··· 1072 .open = sonypi_misc_open, 1073 .release = sonypi_misc_release, 1074 .fasync = sonypi_misc_fasync, 1075 - .ioctl = sonypi_misc_ioctl, 1076 }; 1077 1078 static struct miscdevice sonypi_misc_device = {
··· 50 #include <linux/err.h> 51 #include <linux/kfifo.h> 52 #include <linux/platform_device.h> 53 54 #include <asm/uaccess.h> 55 #include <asm/io.h> ··· 905 906 static int sonypi_misc_open(struct inode *inode, struct file *file) 907 { 908 mutex_lock(&sonypi_device.lock); 909 /* Flush input queue on first open */ 910 if (!sonypi_device.open_count) 911 kfifo_reset(&sonypi_device.fifo); 912 sonypi_device.open_count++; 913 mutex_unlock(&sonypi_device.lock); 914 + 915 return 0; 916 } 917 ··· 955 return 0; 956 } 957 958 + static long sonypi_misc_ioctl(struct file *fp, 959 unsigned int cmd, unsigned long arg) 960 { 961 + long ret = 0; 962 void __user *argp = (void __user *)arg; 963 u8 val8; 964 u16 val16; ··· 1074 .open = sonypi_misc_open, 1075 .release = sonypi_misc_release, 1076 .fasync = sonypi_misc_fasync, 1077 + .unlocked_ioctl = sonypi_misc_ioctl, 1078 + .llseek = no_llseek, 1079 }; 1080 1081 static struct miscdevice sonypi_misc_device = {