OSDN Git Service

drivers: PL011: avoid potential unregister_driver call
authorAndre Przywara <andre.przywara@arm.com>
Thu, 21 May 2015 16:26:14 +0000 (17:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 20:08:50 +0000 (13:08 -0700)
commit49bb3c862cc418e3bc9464654e4ccb8ebb5cc2ec
tree955cf1bc032750179e06436143ec3ae4513ef17a
parent7798edeebc8101b1e8b1d7fb9eee3710f0877cbc
drivers: PL011: avoid potential unregister_driver call

Although we care about not unregistering the driver if there are
still ports connected during the .remove callback, we do miss this
check in the pl011_probe function. So if the current port allocation
fails, but there are other ports already registered, we will kill
those.
So factor out the port removal into a separate function and use that
in the probe function, too.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/amba-pl011.c