diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-06-05 13:28:09 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-09-26 16:25:52 +0200 |
commit | 6117d2130c9da5977e975ad9fa607b86d6516a44 (patch) | |
tree | 33bdc9860f330dce32867b7eea4b96d0c56fb2c1 /drivers/pnp | |
parent | cfdb00a77ea7d5fb922fd985e5dfbcb36873411b (diff) | |
download | kernel_samsung_smdk4412-6117d2130c9da5977e975ad9fa607b86d6516a44.zip kernel_samsung_smdk4412-6117d2130c9da5977e975ad9fa607b86d6516a44.tar.gz kernel_samsung_smdk4412-6117d2130c9da5977e975ad9fa607b86d6516a44.tar.bz2 |
isapnp: BKL removal
Remove BKL use from isapnp_proc_bus_lseek(), like was done for
proc_bus_pci_lseek() a long time ago and recently for Zorro
by Geert Uytterhoeven.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/isapnp/proc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 3f94eda..e73ebef 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c @@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL; static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) { loff_t new = -1; + struct inode *inode = file->f_path.dentry->d_inode; - lock_kernel(); + mutex_lock(&inode->i_mutex); switch (whence) { case 0: new = off; @@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) new = 256 + off; break; } - if (new < 0 || new > 256) { - unlock_kernel(); - return -EINVAL; - } - unlock_kernel(); - return (file->f_pos = new); + if (new < 0 || new > 256) + new = -EINVAL; + else + file->f_pos = new; + mutex_unlock(&inode->i_mutex); + return new; } static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, |