OSDN Git Service

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)
commit5e9bd2d70ae7c00a95a22994abf1eef728649e64
tree6d92b2e7232500e8370eeec4176436c2af6e3e44
parenta553add0846f355a28ed4e81134012e4a1e280c2
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: ab262666018d ("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