Commit b0f9668c authored by Alexander Viro's avatar Alexander Viro Committed by Christoph Hellwig

[PATCH] tty cleanups (8/12)

	* generic_serial.c typo fix (->driver used instead of correct
->driver_data)
	* tubio cleaned up
parent ce2b651f
...@@ -112,7 +112,7 @@ int gs_write(struct tty_struct * tty, int from_user, ...@@ -112,7 +112,7 @@ int gs_write(struct tty_struct * tty, int from_user,
if (!tty) return 0; if (!tty) return 0;
port = tty->driver; port = tty->driver_data;
if (!port) return 0; if (!port) return 0;
......
...@@ -383,17 +383,9 @@ extern inline tub_t *INODE2TUB(struct inode *ip) ...@@ -383,17 +383,9 @@ extern inline tub_t *INODE2TUB(struct inode *ip)
{ {
unsigned int minor = minor(ip->i_rdev); unsigned int minor = minor(ip->i_rdev);
tub_t *tubp = NULL; tub_t *tubp = NULL;
if (minor == 0 && current->tty != NULL) { if (minor == 0 && current->tty) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) if (current->tty->driver == &tty3270_driver)
#ifdef CONFIG_TN3270_CONSOLE minor = current->tty->index;
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 <= tubnummins && minor > 0) if (minor <= tubnummins && minor > 0)
tubp = (*tubminors)[minor]; tubp = (*tubminors)[minor];
...@@ -405,18 +397,11 @@ extern inline tub_t *INODE2TUB(struct inode *ip) ...@@ -405,18 +397,11 @@ extern inline tub_t *INODE2TUB(struct inode *ip)
*/ */
extern inline tub_t *TTY2TUB(struct tty_struct *tty) extern inline tub_t *TTY2TUB(struct tty_struct *tty)
{ {
unsigned int minor = minor(tty->device); unsigned index = tty->index;
tub_t *tubp = NULL; tub_t *tubp = NULL;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) if (index <= tubnummins && index > 0)
#ifdef CONFIG_TN3270_CONSOLE tubp = (*tubminors)[index];
if (tty->device == S390_CONSOLE_DEV)
tubp = tub3270_con_tubp;
else
#endif
#endif
if (minor <= tubnummins && minor > 0)
tubp = (*tubminors)[minor];
return tubp; return tubp;
} }
......
...@@ -539,16 +539,8 @@ tty3270_write_proc(struct file *file, const char *buffer, ...@@ -539,16 +539,8 @@ tty3270_write_proc(struct file *file, const char *buffer,
*/ */
tubp = NULL; tubp = NULL;
tty = current->tty; tty = current->tty;
if (tty) { if (tty && tty->driver == &tty3270_driver)
if (tub_major(tty->device) == IBM_TTY3270_MAJOR) tubp = (*tubminors)[tty->index];
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 (tubp) { if (tubp) {
if ((rc = tty3270_aid_set(tubp, mybuf, mycount + 1))) if ((rc = tty3270_aid_set(tubp, mybuf, mycount + 1)))
return rc > 0? count: rc; return rc > 0? count: rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment