tty: serial_core: convert uart_open to use tty_port_open
authorRob Herring <robh@kernel.org>
Mon, 22 Aug 2016 22:39:09 +0000 (17:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 13:42:28 +0000 (15:42 +0200)
commitb3b57646186400d4f54652ab7bbf55f5764d9467
tree08be5a5db4059fe81e02743b7c2810e6dcaa7283
parentebaa81c7287edd40dd4899e5d93a20e7a2b938e7
tty: serial_core: convert uart_open to use tty_port_open

tty_port_open handles much of the common parts of tty opening. Convert
uart_open to use it and move the serial_core specific parts into
tty_port.activate function. This will be needed to use tty_port functions
directly from in kernel clients.

The tricky part is uart_port_startup can return positive values to allow
setserial to configure the port. We now return the positive value to
tty_port_open so that the tty is not marked as initialized and then set the
return value in uart_open to 0.

Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c