]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
tty: move tioclinux from a special case
authorAlan Cox <alan@redhat.com>
Mon, 13 Oct 2008 09:36:40 +0000 (10:36 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Oct 2008 16:51:40 +0000 (09:51 -0700)
Right now we have ifdefs and hooks in the core ioctl handler for TIOCLINUX
and then test if its a console. This is brain dead. Instead call the
tioclinux helper from the relevant driver ioctl methods.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/tty_io.c
drivers/char/vt.c
drivers/char/vt_ioctl.c

index e4dce87095410f8f648137ecb992927a6630c483..2f05728920e7082f509ce1eaa5f35cdda38901d9 100644 (file)
@@ -3026,10 +3026,6 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return put_user(tty->ldisc.ops->num, (int __user *)p);
        case TIOCSETD:
                return tiocsetd(tty, p);
-#ifdef CONFIG_VT
-       case TIOCLINUX:
-               return tioclinux(tty, arg);
-#endif
        /*
         * Break handling
         */
index 60359c360912c7d4dddee8e76a6a4ffb2c576e7e..05ca1c5dcb1c6a0e4517d822b1f3573f54d1adc6 100644 (file)
@@ -2583,8 +2583,6 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
        int lines;
        int ret;
 
-       if (tty->driver->type != TTY_DRIVER_TYPE_CONSOLE)
-               return -EINVAL;
        if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN))
                return -EPERM;
        if (get_user(type, p))
index c904e9ad4a71a396d5fa3c06747065b99335d392..8944ce508e2fea56a489501023a7dcdc8a22bb81 100644 (file)
@@ -395,6 +395,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
  
        kbd = kbd_table + console;
        switch (cmd) {
+       case TIOCLINUX:
+               return tioclinux(tty, arg);
        case KIOCSOUND:
                if (!perm)
                        goto eperm;