Commit b5d68c13 authored by Shmulik Ladkani's avatar Shmulik Ladkani Committed by james toy

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: default avatarShmulik Ladkani <shmulik@jungo.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 195fd228
...@@ -2691,6 +2691,15 @@ static void __init serial8250_isa_init_ports(void) ...@@ -2691,6 +2691,15 @@ static void __init serial8250_isa_init_ports(void)
} }
} }
static void
serial8250_init_fixed_type_port(struct uart_8250_port *up, unsigned int type)
{
up->port.type = type;
up->port.fifosize = uart_config[type].fifo_size;
up->capabilities = uart_config[type].flags;
up->tx_loadsz = uart_config[type].tx_loadsz;
}
static void __init static void __init
serial8250_register_ports(struct uart_driver *drv, struct device *dev) serial8250_register_ports(struct uart_driver *drv, struct device *dev)
{ {
...@@ -2707,6 +2716,10 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) ...@@ -2707,6 +2716,10 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
struct uart_8250_port *up = &serial8250_ports[i]; struct uart_8250_port *up = &serial8250_ports[i];
up->port.dev = dev; up->port.dev = dev;
if (up->port.flags & UPF_FIXED_TYPE)
serial8250_init_fixed_type_port(up, up->port.type);
uart_add_one_port(drv, &up->port); uart_add_one_port(drv, &up->port);
} }
} }
...@@ -3119,12 +3132,8 @@ int serial8250_register_port(struct uart_port *port) ...@@ -3119,12 +3132,8 @@ int serial8250_register_port(struct uart_port *port)
if (port->dev) if (port->dev)
uart->port.dev = port->dev; uart->port.dev = port->dev;
if (port->flags & UPF_FIXED_TYPE) { if (port->flags & UPF_FIXED_TYPE)
uart->port.type = port->type; serial8250_init_fixed_type_port(uart, port->type);
uart->port.fifosize = uart_config[port->type].fifo_size;
uart->capabilities = uart_config[port->type].flags;
uart->tx_loadsz = uart_config[port->type].tx_loadsz;
}
set_io_from_upio(&uart->port); set_io_from_upio(&uart->port);
/* Possibly override default I/O functions. */ /* Possibly override default I/O functions. */
......
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