serial: mps2-uart: move to dynamic port allocation
authorVladimir Murzin <vladimir.murzin@arm.com>
Wed, 30 Jan 2019 09:55:14 +0000 (09:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 10:48:08 +0000 (11:48 +0100)
commit9f25e07b882bd167a952abc4bf10b37e95893110
tree91c25477262388f513e12a49afa91b18d5c82fe7
parent3c635e4f14482bc11e25461892f3ae193e5266f8
serial: mps2-uart: move to dynamic port allocation

Some designs, like MPS3, expose number of virtual serial ports which
already close or exceeds MPS2_MAX_PORTS. Increasing MPS2_MAX_PORTS
would have negative impact (in terms of memory consumption) on tiny
MPS2 platform which, in fact, has only one physically populated UART.

Start with converting existent static port array to idr. As a bonus it
make driver not to fail in case when no alias was specified in device
tree.

Note: there is no need in idr_destroy() because code doesn't unload
since ce87122911f8 ("serial: mps2-uart: make driver explicitly non-modular")

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mps2-uart.c