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,
if (!tty) return 0;
port = tty->driver;
port = tty->driver_data;
if (!port) return 0;
......
......@@ -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;
}
......
......@@ -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;
......
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