Commit 7f56f3bc authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] callout removal: a2232

callout removal: a2232
parent 55a38666
...@@ -172,7 +172,6 @@ static struct a2232_port a2232_ports[MAX_A2232_BOARDS*NUMLINES]; ...@@ -172,7 +172,6 @@ static struct a2232_port a2232_ports[MAX_A2232_BOARDS*NUMLINES];
/* TTY driver structs */ /* TTY driver structs */
static struct tty_driver a2232_driver; static struct tty_driver a2232_driver;
static struct tty_driver a2232_callout_driver;
/* Variables used by the TTY driver */ /* Variables used by the TTY driver */
static int a2232_refcount; static int a2232_refcount;
...@@ -474,16 +473,10 @@ static int a2232_open(struct tty_struct * tty, struct file * filp) ...@@ -474,16 +473,10 @@ static int a2232_open(struct tty_struct * tty, struct file * filp)
} }
if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)){ if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)){
if (tty->driver->subtype == A2232_TTY_SUBTYPE_NORMAL) *tty->termios = port->gs.normal_termios;
*tty->termios = port->gs.normal_termios;
else
*tty->termios = port->gs.callout_termios;
a2232_set_real_termios (port); a2232_set_real_termios (port);
} }
port->gs.session = current->session;
port->gs.pgrp = current->pgrp;
a2232_enable_rx_interrupts(port); a2232_enable_rx_interrupts(port);
return 0; return 0;
...@@ -649,18 +642,13 @@ int ch, err, n, p; ...@@ -649,18 +642,13 @@ int ch, err, n, p;
if (!(port->gs.flags & ASYNC_CHECK_CD)) if (!(port->gs.flags & ASYNC_CHECK_CD))
; /* Don't report DCD changes */ ; /* Don't report DCD changes */
else if (port->cd_status) { // if DCD on: DCD went UP! else if (port->cd_status) { // if DCD on: DCD went UP!
if (~(port->gs.flags & ASYNC_NORMAL_ACTIVE) ||
~(port->gs.flags & ASYNC_CALLOUT_ACTIVE)) { /* Are we blocking in open?*/
/* Are we blocking in open?*/ wake_up_interruptible(&port->gs.open_wait);
wake_up_interruptible(&port->gs.open_wait);
}
} }
else { // if DCD off: DCD went DOWN! else { // if DCD off: DCD went DOWN!
if (!((port->gs.flags & ASYNC_CALLOUT_ACTIVE) && if (port->gs.tty)
(port->gs.flags & ASYNC_CALLOUT_NOHUP))) { tty_hangup (port->gs.tty);
if (port->gs.tty)
tty_hangup (port->gs.tty);
}
} }
} // if CD changed for this port } // if CD changed for this port
...@@ -686,7 +674,6 @@ static void a2232_init_portstructs(void) ...@@ -686,7 +674,6 @@ static void a2232_init_portstructs(void)
port->which_a2232 = i/NUMLINES; port->which_a2232 = i/NUMLINES;
port->which_port_on_a2232 = i%NUMLINES; port->which_port_on_a2232 = i%NUMLINES;
port->disable_rx = port->throttle_input = port->cd_status = 0; port->disable_rx = port->throttle_input = port->cd_status = 0;
port->gs.callout_termios = tty_std_termios;
port->gs.normal_termios = tty_std_termios; port->gs.normal_termios = tty_std_termios;
port->gs.magic = A2232_MAGIC; port->gs.magic = A2232_MAGIC;
port->gs.close_delay = HZ/2; port->gs.close_delay = HZ/2;
...@@ -738,22 +725,11 @@ static int a2232_init_drivers(void) ...@@ -738,22 +725,11 @@ static int a2232_init_drivers(void)
a2232_driver.start = gs_start; a2232_driver.start = gs_start;
a2232_driver.hangup = gs_hangup; a2232_driver.hangup = gs_hangup;
a2232_callout_driver = a2232_driver;
a2232_callout_driver.name = "cuy";
a2232_callout_driver.major = A2232_CALLOUT_MAJOR;
a2232_callout_driver.subtype = A2232_TTY_SUBTYPE_CALLOUT;
if ((error = tty_register_driver(&a2232_driver))) { if ((error = tty_register_driver(&a2232_driver))) {
printk(KERN_ERR "A2232: Couldn't register A2232 driver, error = %d\n", printk(KERN_ERR "A2232: Couldn't register A2232 driver, error = %d\n",
error); error);
return 1; return 1;
} }
if ((error = tty_register_driver(&a2232_callout_driver))) {
tty_unregister_driver(&a2232_driver);
printk(KERN_ERR "A2232: Couldn't register A2232 callout driver, error = %d\n",
error);
return 1;
}
return 0; return 0;
} }
...@@ -865,7 +841,6 @@ void cleanup_module(void) ...@@ -865,7 +841,6 @@ void cleanup_module(void)
} }
tty_unregister_driver(&a2232_driver); tty_unregister_driver(&a2232_driver);
tty_unregister_driver(&a2232_callout_driver);
free_irq(IRQ_AMIGA_VERTB, a2232_driver_ID); free_irq(IRQ_AMIGA_VERTB, a2232_driver_ID);
} }
#endif #endif
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
/* for the tty_struct subtype field */ /* for the tty_struct subtype field */
#define A2232_TTY_SUBTYPE_NORMAL 1 #define A2232_TTY_SUBTYPE_NORMAL 1
#define A2232_TTY_SUBTYPE_CALLOUT 2
/* A2232 port structure to keep track of the /* A2232 port structure to keep track of the
status of every single line used */ status of every single line used */
......
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