aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-09-19 16:13:28 -0400
committerLive-CD User <linux@linux.site>2009-09-19 16:13:28 -0400
commit5e99df561fc830730d63672d795a0b02ef8cdd6f (patch)
tree6fffbbb737a7d01d58b7b9415f041bd50fca26b4 /drivers
parentebd2c8f6d2ec4012c267ecb95e72a57b8355a705 (diff)
serial: Fold closing_* fields into the tty_port ones
Remove some more serial specific use Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_core.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index ea53b6f224b0..2d63b13e2f7e 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -651,10 +651,10 @@ static int uart_get_info(struct uart_state *state,
651 tmp.flags = port->flags; 651 tmp.flags = port->flags;
652 tmp.xmit_fifo_size = port->fifosize; 652 tmp.xmit_fifo_size = port->fifosize;
653 tmp.baud_base = port->uartclk / 16; 653 tmp.baud_base = port->uartclk / 16;
654 tmp.close_delay = state->close_delay / 10; 654 tmp.close_delay = state->port.close_delay / 10;
655 tmp.closing_wait = state->closing_wait == USF_CLOSING_WAIT_NONE ? 655 tmp.closing_wait = state->port.closing_wait == USF_CLOSING_WAIT_NONE ?
656 ASYNC_CLOSING_WAIT_NONE : 656 ASYNC_CLOSING_WAIT_NONE :
657 state->closing_wait / 10; 657 state->port.closing_wait / 10;
658 tmp.custom_divisor = port->custom_divisor; 658 tmp.custom_divisor = port->custom_divisor;
659 tmp.hub6 = port->hub6; 659 tmp.hub6 = port->hub6;
660 tmp.io_type = port->iotype; 660 tmp.io_type = port->iotype;
@@ -724,8 +724,8 @@ static int uart_set_info(struct uart_state *state,
724 retval = -EPERM; 724 retval = -EPERM;
725 if (change_irq || change_port || 725 if (change_irq || change_port ||
726 (new_serial.baud_base != port->uartclk / 16) || 726 (new_serial.baud_base != port->uartclk / 16) ||
727 (close_delay != state->close_delay) || 727 (close_delay != state->port.close_delay) ||
728 (closing_wait != state->closing_wait) || 728 (closing_wait != state->port.closing_wait) ||
729 (new_serial.xmit_fifo_size && 729 (new_serial.xmit_fifo_size &&
730 new_serial.xmit_fifo_size != port->fifosize) || 730 new_serial.xmit_fifo_size != port->fifosize) ||
731 (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0)) 731 (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0))
@@ -834,8 +834,8 @@ static int uart_set_info(struct uart_state *state,
834 port->flags = (port->flags & ~UPF_CHANGE_MASK) | 834 port->flags = (port->flags & ~UPF_CHANGE_MASK) |
835 (new_flags & UPF_CHANGE_MASK); 835 (new_flags & UPF_CHANGE_MASK);
836 port->custom_divisor = new_serial.custom_divisor; 836 port->custom_divisor = new_serial.custom_divisor;
837 state->close_delay = close_delay; 837 state->port.close_delay = close_delay;
838 state->closing_wait = closing_wait; 838 state->port.closing_wait = closing_wait;
839 if (new_serial.xmit_fifo_size) 839 if (new_serial.xmit_fifo_size)
840 port->fifosize = new_serial.xmit_fifo_size; 840 port->fifosize = new_serial.xmit_fifo_size;
841 if (state->port.tty) 841 if (state->port.tty)
@@ -1297,8 +1297,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1297 */ 1297 */
1298 tty->closing = 1; 1298 tty->closing = 1;
1299 1299
1300 if (state->closing_wait != USF_CLOSING_WAIT_NONE) 1300 if (state->port.closing_wait != USF_CLOSING_WAIT_NONE)
1301 tty_wait_until_sent(tty, msecs_to_jiffies(state->closing_wait)); 1301 tty_wait_until_sent(tty, msecs_to_jiffies(state->port.closing_wait));
1302 1302
1303 /* 1303 /*
1304 * At this point, we stop accepting input. To do this, we 1304 * At this point, we stop accepting input. To do this, we
@@ -1326,8 +1326,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1326 state->port.tty = NULL; 1326 state->port.tty = NULL;
1327 1327
1328 if (state->port.blocked_open) { 1328 if (state->port.blocked_open) {
1329 if (state->close_delay) 1329 if (state->port.close_delay)
1330 msleep_interruptible(state->close_delay); 1330 msleep_interruptible(state->port.close_delay);
1331 } else if (!uart_console(port)) { 1331 } else if (!uart_console(port)) {
1332 uart_change_pm(state, 3); 1332 uart_change_pm(state, 3);
1333 } 1333 }
@@ -2358,11 +2358,11 @@ int uart_register_driver(struct uart_driver *drv)
2358 for (i = 0; i < drv->nr; i++) { 2358 for (i = 0; i < drv->nr; i++) {
2359 struct uart_state *state = drv->state + i; 2359 struct uart_state *state = drv->state + i;
2360 2360
2361 state->close_delay = 500; /* .5 seconds */
2362 state->closing_wait = 30000; /* 30 seconds */
2363 mutex_init(&state->mutex); 2361 mutex_init(&state->mutex);
2364 2362
2365 tty_port_init(&state->port); 2363 tty_port_init(&state->port);
2364 state->port.close_delay = 500; /* .5 seconds */
2365 state->port.closing_wait = 30000; /* 30 seconds */
2366 init_waitqueue_head(&state->delta_msr_wait); 2366 init_waitqueue_head(&state->delta_msr_wait);
2367 tasklet_init(&state->tlet, uart_tasklet_action, 2367 tasklet_init(&state->tlet, uart_tasklet_action,
2368 (unsigned long)state); 2368 (unsigned long)state);