aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/8250.c
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik@jungo.com>2009-12-09 15:31:29 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:43:07 -0500
commitb5d228cc4f854aebcefac987d111fc072ecd15e0 (patch)
tree3663199cff0d18cf78a6da2fc03696708cb914e6 /drivers/serial/8250.c
parentccf68e59e93181df9353c0cc721459d18ff200b6 (diff)
serial: copy UART properties of UPF_FIXED_TYPE ports provisioned using early_serial_setup
Augment the UPF_FIXED_TYPE logic, which currently applies to UART ports provisioned using platform_device_register. The suggested patch applies same logic into 'serial8250_register_ports', making UART ports provisioned using early_serial_setup inherit their properties from the uart_config entry. Signed-off-by: Shmulik Ladkani <shmulik@jungo.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r--drivers/serial/8250.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index a81ff7bc5fa1..7c4ebe6ee18b 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2690,6 +2690,15 @@ static void __init serial8250_isa_init_ports(void)
2690 } 2690 }
2691} 2691}
2692 2692
2693static void
2694serial8250_init_fixed_type_port(struct uart_8250_port *up, unsigned int type)
2695{
2696 up->port.type = type;
2697 up->port.fifosize = uart_config[type].fifo_size;
2698 up->capabilities = uart_config[type].flags;
2699 up->tx_loadsz = uart_config[type].tx_loadsz;
2700}
2701
2693static void __init 2702static void __init
2694serial8250_register_ports(struct uart_driver *drv, struct device *dev) 2703serial8250_register_ports(struct uart_driver *drv, struct device *dev)
2695{ 2704{
@@ -2706,6 +2715,10 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
2706 struct uart_8250_port *up = &serial8250_ports[i]; 2715 struct uart_8250_port *up = &serial8250_ports[i];
2707 2716
2708 up->port.dev = dev; 2717 up->port.dev = dev;
2718
2719 if (up->port.flags & UPF_FIXED_TYPE)
2720 serial8250_init_fixed_type_port(up, up->port.type);
2721
2709 uart_add_one_port(drv, &up->port); 2722 uart_add_one_port(drv, &up->port);
2710 } 2723 }
2711} 2724}
@@ -3118,12 +3131,8 @@ int serial8250_register_port(struct uart_port *port)
3118 if (port->dev) 3131 if (port->dev)
3119 uart->port.dev = port->dev; 3132 uart->port.dev = port->dev;
3120 3133
3121 if (port->flags & UPF_FIXED_TYPE) { 3134 if (port->flags & UPF_FIXED_TYPE)
3122 uart->port.type = port->type; 3135 serial8250_init_fixed_type_port(uart, port->type);
3123 uart->port.fifosize = uart_config[port->type].fifo_size;
3124 uart->capabilities = uart_config[port->type].flags;
3125 uart->tx_loadsz = uart_config[port->type].tx_loadsz;
3126 }
3127 3136
3128 set_io_from_upio(&uart->port); 3137 set_io_from_upio(&uart->port);
3129 /* Possibly override default I/O functions. */ 3138 /* Possibly override default I/O functions. */