aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:41 -0400
commitd17468c73e138e1108b279acf892dd35937d43ed (patch)
treea572b8d50de0146c60f15425de03e8af92832dd5 /drivers/char/tty_io.c
parent1c2630ccf922b7ea2c54c184243d4fb2bd2cf3c6 (diff)
tty: drop the BKL for driver/ldisc ioctl methods
Now we have pushed the lock down we can stop wrapping the call with a lock in the tty layer. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 2460c4c76161..35c7d2eb8b28 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3459,11 +3459,8 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
3459 switch (cmd) { 3459 switch (cmd) {
3460 case TIOCSBRK: 3460 case TIOCSBRK:
3461 case TIOCCBRK: 3461 case TIOCCBRK:
3462 if (tty->driver->ioctl) { 3462 if (tty->driver->ioctl)
3463 lock_kernel();
3464 retval = tty->driver->ioctl(tty, file, cmd, arg); 3463 retval = tty->driver->ioctl(tty, file, cmd, arg);
3465 unlock_kernel();
3466 }
3467 return retval; 3464 return retval;
3468 3465
3469 /* These two ioctl's always return success; even if */ 3466 /* These two ioctl's always return success; even if */
@@ -3584,18 +3581,14 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
3584 break; 3581 break;
3585 } 3582 }
3586 if (tty->driver->ioctl) { 3583 if (tty->driver->ioctl) {
3587 lock_kernel();
3588 retval = (tty->driver->ioctl)(tty, file, cmd, arg); 3584 retval = (tty->driver->ioctl)(tty, file, cmd, arg);
3589 unlock_kernel();
3590 if (retval != -ENOIOCTLCMD) 3585 if (retval != -ENOIOCTLCMD)
3591 return retval; 3586 return retval;
3592 } 3587 }
3593 ld = tty_ldisc_ref_wait(tty); 3588 ld = tty_ldisc_ref_wait(tty);
3594 retval = -EINVAL; 3589 retval = -EINVAL;
3595 if (ld->ioctl) { 3590 if (ld->ioctl) {
3596 lock_kernel();
3597 retval = ld->ioctl(tty, file, cmd, arg); 3591 retval = ld->ioctl(tty, file, cmd, arg);
3598 unlock_kernel();
3599 if (retval == -ENOIOCTLCMD) 3592 if (retval == -ENOIOCTLCMD)
3600 retval = -EINVAL; 3593 retval = -EINVAL;
3601 } 3594 }