Skip to content

Commit

Permalink
zorro: BKL removal
Browse files Browse the repository at this point in the history
Remove BKL use from proc_bus_zorro_lseek(), like was done for
proc_bus_pci_lseek() a long time ago.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Geert Uytterhoeven committed Aug 9, 2010
1 parent d643e2d commit d50ac46
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/zorro/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ static loff_t
proc_bus_zorro_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 @@ -35,12 +36,12 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
new = sizeof(struct ConfigDev) + off;
break;
}
if (new < 0 || new > sizeof(struct ConfigDev)) {
unlock_kernel();
return -EINVAL;
}
unlock_kernel();
return (file->f_pos = new);
if (new < 0 || new > sizeof(struct ConfigDev))
new = -EINVAL;
else
file->f_pos = new;
mutex_unlock(&inode->i_mutex);
return new;
}

static ssize_t
Expand Down

0 comments on commit d50ac46

Please sign in to comment.