From b0f9668c42f7745b2612896c71adbd980094f562 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Wed, 23 Apr 2003 04:19:18 -0700 Subject: [PATCH] [PATCH] tty cleanups (8/12) * generic_serial.c typo fix (->driver used instead of correct ->driver_data) * tubio cleaned up --- drivers/char/generic_serial.c | 2 +- drivers/s390/char/tubio.h | 27 ++++++--------------------- drivers/s390/char/tubtty.c | 12 ++---------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 67ae488451d29..9179a95389a27 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -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; diff --git a/drivers/s390/char/tubio.h b/drivers/s390/char/tubio.h index a8fa57d360132..62b36b9a5b5a3 100644 --- a/drivers/s390/char/tubio.h +++ b/drivers/s390/char/tubio.h @@ -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; } diff --git a/drivers/s390/char/tubtty.c b/drivers/s390/char/tubtty.c index b7b6a5a3c489c..9853e174a191f 100644 --- a/drivers/s390/char/tubtty.c +++ b/drivers/s390/char/tubtty.c @@ -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; -- 2.53.0