summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-01-16 00:36:48 +0100
committerSimone Willett <swillett@nvidia.com>2012-02-08 14:31:57 -0800
commit6e652e8feb766b27f9f6fa026d40aa31a2f1b8db (patch)
treeb073f7b49df44a6c65c283ca8f9d82e43135ec33 /drivers
parent6c39a95def1ddf72ca19e428d440b3021cbf3428 (diff)
USB: cp210x: call generic open last in open
commit 55b2afbb92ad92e9f6b0aa4354eb1c94589280c3 upstream. Make sure port is fully initialised before calling generic open. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: I7355877d73350ffbfff6fc2f00bdf6e71690144b Reviewed-on: http://git-master/r/79699 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/cp210x.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 3b43d9b6668f..cbcaddb1bf4c 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -393,8 +393,6 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
{
- int result;
-
dbg("%s - port %d", __func__, port->number);
if (cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_ENABLE)) {
@@ -403,13 +401,10 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
return -EPROTO;
}
- result = usb_serial_generic_open(tty, port);
- if (result)
- return result;
-
/* Configure the termios structure */
cp210x_get_termios(tty, port);
- return 0;
+
+ return usb_serial_generic_open(tty, port);
}
static void cp210x_close(struct usb_serial_port *port)