summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2019-09-02 16:27:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-04 14:58:05 +0200
commit91daae03188e0dd1da3c1b599df4ce7539d5a69f (patch)
tree43b630ad36eaa2c27eb5180e4a64aadd7c00173d /drivers/tty
parent0c11b88883db1a83980633fc88091d3cdd79bd48 (diff)
serial: core: Use cons->index for preferred console registration
The reason for this patch is xilinx_uartps driver which create one dynamic instance per IP with unique major and minor combinations. drv->nr is in this case all the time setup to 1. That means that uport->line is all the time setup to 0 and drv->tty_driver->name_base is doing shift in name to for example ttyPS3. register_console() is looping over console_cmdline array and looking for proper name/index combination which is in our case ttyPS/3. That's why every instance of driver needs to be registered with proper combination of name/number (ttyPS/3). Using uport->line is doing registration with ttyPS/0 which is wrong that's why proper console index should be used which is in cons->index field. Also it is visible that recording console should be done based on information about console not about the port but in most cases numbers are the same and xilinx_uartps is only one exception now. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/4a877f1c7189a7c45b59a6ebfc3de607e8758949.1567434470.git.michal.simek@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 6e713be1d4e9..937412d9102d 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2830,7 +2830,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
lockdep_set_class(&uport->lock, &port_lock_key);
}
if (uport->cons && uport->dev)
- of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
+ of_console_check(uport->dev->of_node, uport->cons->name,
+ uport->cons->index);
uart_configure_port(drv, state, uport);