• Michal Simek's avatar
    serial: uartps: Register own uart console and driver structures · 024ca329
    Michal Simek authored
    Every instance is registering own struct console and struct uart_driver
    with minor number which corresponds to alias ID (or 0 now) and with 1 uart
    port. The same alias ID is saved to tty_driver->name_base which is key
    field for creating ttyPSX name.
    
    Because name_base and minor number are setup already there is no need to
    setup any port->line number because 0 is the right value.
    
    Unfortunately this driver is setting up major number to 0 for using
    dynamic assignment and kernel is allocating different major numbers for
    every instance instead of using the same major and different minor
    number.
    
    ~# ls -la /dev/ttyPS*
    crw-------    1 root     root      252,   0 Jan  1 03:36 /dev/ttyPS0
    crw--w----    1 root     root      253,   1 Jan  1 00:00 /dev/ttyPS1
    
    When major number is not 0. For example 252 then major/minor
    combinations are in expected form
    
    ~# ls -la /dev/ttyPS*
    crw-------    1 root     root      252,   0 Jan  1 04:04 /dev/ttyPS0
    crw--w----    1 root     root      252,   1 Jan  1 00:00 /dev/ttyPS1
    
    Driver is not freeing struct cdns_uart_console in case that instance is
    not used as console. The reason is that console is incorrectly unregistred
    and "console [0] disabled" message will be shown.
    Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    024ca329
xilinx_uartps.c 47.1 KB