]> git.hungrycats.org Git - linux/commitdiff
[PATCH] tty cleanups (8/12)
authorAlexander Viro <viro@www.linux.org.uk>
Wed, 23 Apr 2003 11:19:18 +0000 (04:19 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 23 Apr 2003 11:19:18 +0000 (04:19 -0700)
* generic_serial.c typo fix (->driver used instead of correct
->driver_data)
* tubio cleaned up

drivers/char/generic_serial.c
drivers/s390/char/tubio.h
drivers/s390/char/tubtty.c

index 67ae488451d291f980301596b142dc2d7e98eb14..9179a95389a27b2cfa7fb2eb9b0b27803a2c447f 100644 (file)
@@ -112,7 +112,7 @@ int gs_write(struct tty_struct * tty, int from_user,
 
        if (!tty) return 0;
 
-       port = tty->driver;
+       port = tty->driver_data;
 
        if (!port) return 0;
 
index a8fa57d360132aad20bbf52aaf49ba632b6edbac..62b36b9a5b5a38650bb6f74bc77dc1d6f759098f 100644 (file)
@@ -383,17 +383,9 @@ extern inline tub_t *INODE2TUB(struct inode *ip)
 {
        unsigned int minor = minor(ip->i_rdev);
        tub_t *tubp = NULL;
-       if (minor == 0 && current->tty != NULL) {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-#ifdef CONFIG_TN3270_CONSOLE
-               if (tub3270_con_tubp != NULL &&
-                   current->tty->device == S390_CONSOLE_DEV)
-                       minor = tub3270_con_tubp->minor;
-               else
-#endif
-#endif
-               if (tub_major(current->tty->device) == IBM_TTY3270_MAJOR)
-                       minor = tub_minor(current->tty->device);
+       if (minor == 0 && current->tty) {
+               if (current->tty->driver == &tty3270_driver)
+                       minor = current->tty->index;
        }
        if (minor <= tubnummins && minor > 0)
                tubp = (*tubminors)[minor];
@@ -405,18 +397,11 @@ extern inline tub_t *INODE2TUB(struct inode *ip)
  */
 extern inline tub_t *TTY2TUB(struct tty_struct *tty)
 {
-       unsigned int minor = minor(tty->device);
+       unsigned index = tty->index;
        tub_t *tubp = NULL;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-#ifdef CONFIG_TN3270_CONSOLE
-       if (tty->device == S390_CONSOLE_DEV)
-               tubp = tub3270_con_tubp;
-       else
-#endif
-#endif
-       if (minor <= tubnummins && minor > 0)
-               tubp = (*tubminors)[minor];
+       if (index <= tubnummins && index > 0)
+               tubp = (*tubminors)[index];
        return tubp;
 }
 
index b7b6a5a3c489c2dd37bd5df57a9c51a85e6f4bd7..9853e174a191f3dad8ddb17c9240309977f8b5e7 100644 (file)
@@ -539,16 +539,8 @@ tty3270_write_proc(struct file *file, const char *buffer,
         */
        tubp = NULL;
        tty = current->tty;
-       if (tty) {
-               if (tub_major(tty->device) == IBM_TTY3270_MAJOR)
-                       tubp = (*tubminors)[tub_minor(tty->device)];
-#ifdef CONFIG_TN3270_CONSOLE
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
-               if (CONSOLE_IS_3270 && tty->device == S390_CONSOLE_DEV)
-                       tubp = tub3270_con_tubp;
-#endif /* LINUX_VERSION_CODE */
-#endif /* CONFIG_TN3270_CONSOLE */
-       }
+       if (tty && tty->driver == &tty3270_driver)
+               tubp = (*tubminors)[tty->index];
        if (tubp) {
                if ((rc = tty3270_aid_set(tubp, mybuf, mycount + 1)))
                        return rc > 0? count: rc;