]> git.baikalelectronics.ru Git - kernel.git/commit
serial: uartps: Fix uartps_major handling
authorMichal Simek <michal.simek@xilinx.com>
Fri, 4 Oct 2019 13:04:11 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 13:14:20 +0000 (15:14 +0200)
commit528e976fd2a25225b66e99499dbf16a172149392
tree6d92b2e7232500e8370eeec4176436c2af6e3e44
parent4ef0fdde76ab6754836f126371937eec21ef88db
serial: uartps: Fix uartps_major handling

There are two parts which should be fixed. The first one is to assigned
uartps_major at the end of probe() to avoid complicated logic when
something fails.
The second part is initialized uartps_major number to 0 when last device is
removed. This will ensure that on next probe driver will ask for new
dynamic major number.

Fixes: 4bfb800d1599 ("serial: uartps: Use the same dynamic major number for all ports")
Reported-by: Paul Thomas <pthomas8589@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/d2652cda992833315c4f96f06953eb547f928918.1570194248.git.michal.simek@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/xilinx_uartps.c