aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-02-24 14:25:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 13:17:35 -0400
commit1a53e07989733d72354eb9617f49377ff30588a8 (patch)
tree5c319fd66673ff5494754ac0bdaadc2a28ce981d /drivers/tty
parent0a16e2c1a6221703aa4d4942c95e37d641e87cc7 (diff)
serial: 8250: Encapsulate port i/o method init
Prepare for 8250 split; introduce serial8250_set_defaults() to set default port methods prior to driver override. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_core.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index e59fd1dc1ad5..c5db1395c348 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -3144,6 +3144,13 @@ static void serial8250_init_port(struct uart_8250_port *up)
3144 up->cur_iotype = 0xFF; 3144 up->cur_iotype = 0xFF;
3145} 3145}
3146 3146
3147static void serial8250_set_defaults(struct uart_8250_port *up)
3148{
3149 struct uart_port *port = &up->port;
3150
3151 set_io_from_upio(port);
3152}
3153
3147static void __init serial8250_isa_init_ports(void) 3154static void __init serial8250_isa_init_ports(void)
3148{ 3155{
3149 struct uart_8250_port *up; 3156 struct uart_8250_port *up;
@@ -3193,11 +3200,11 @@ static void __init serial8250_isa_init_ports(void)
3193 port->membase = old_serial_port[i].iomem_base; 3200 port->membase = old_serial_port[i].iomem_base;
3194 port->iotype = old_serial_port[i].io_type; 3201 port->iotype = old_serial_port[i].io_type;
3195 port->regshift = old_serial_port[i].iomem_reg_shift; 3202 port->regshift = old_serial_port[i].iomem_reg_shift;
3196 set_io_from_upio(port); 3203 serial8250_set_defaults(up);
3204
3197 port->irqflags |= irqflag; 3205 port->irqflags |= irqflag;
3198 if (serial8250_isa_config != NULL) 3206 if (serial8250_isa_config != NULL)
3199 serial8250_isa_config(i, &up->port, &up->capabilities); 3207 serial8250_isa_config(i, &up->port, &up->capabilities);
3200
3201 } 3208 }
3202} 3209}
3203 3210
@@ -3481,7 +3488,8 @@ int __init early_serial_setup(struct uart_port *port)
3481 p->type = port->type; 3488 p->type = port->type;
3482 p->line = port->line; 3489 p->line = port->line;
3483 3490
3484 set_io_from_upio(p); 3491 serial8250_set_defaults(up_to_u8250p(p));
3492
3485 if (port->serial_in) 3493 if (port->serial_in)
3486 p->serial_in = port->serial_in; 3494 p->serial_in = port->serial_in;
3487 if (port->serial_out) 3495 if (port->serial_out)
@@ -3751,7 +3759,8 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
3751 if (up->port.flags & UPF_FIXED_TYPE) 3759 if (up->port.flags & UPF_FIXED_TYPE)
3752 serial8250_init_fixed_type_port(uart, up->port.type); 3760 serial8250_init_fixed_type_port(uart, up->port.type);
3753 3761
3754 set_io_from_upio(&uart->port); 3762 serial8250_set_defaults(uart);
3763
3755 /* Possibly override default I/O functions. */ 3764 /* Possibly override default I/O functions. */
3756 if (up->port.serial_in) 3765 if (up->port.serial_in)
3757 uart->port.serial_in = up->port.serial_in; 3766 uart->port.serial_in = up->port.serial_in;