Skip to content

Commit

Permalink
isapnp: BKL removal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann committed Sep 26, 2010
1 parent cfdb00a commit 6117d21
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/pnp/isapnp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 6117d21

Please sign in to comment.