USB: serial: set drain delay at port probe
authorJohan Hovold <jhovold@gmail.com>
Wed, 26 Jun 2013 14:47:23 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:21:50 +0000 (16:21 -0700)
The port drain delay is constant and should be set at port probe rather
than open.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/f81232.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/oti6858.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/spcp8x5.c
drivers/usb/serial/ti_usb_3410_5052.c

index e948dc02795d4ede34c7c132d9fb03a1142cf0f5..558605d646f34432766b736c9b3d430e8a32a871 100644 (file)
@@ -495,6 +495,8 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)
        }
        usb_set_serial_port_data(port, priv);
 
+       port->port.drain_delay = 256;
+
        return 0;
 }
 
@@ -625,7 +627,7 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
                                                        __func__, result);
                cypress_set_dead(port);
        }
-       port->port.drain_delay = 256;
+
        return result;
 } /* cypress_open */
 
index 75e85cbf9e8b38032c8d174963c7b831b515369a..639a18fb67e694e49d1ae6409fda5bb4f528a57f 100644 (file)
@@ -207,7 +207,6 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
                return result;
        }
 
-       port->port.drain_delay = 256;
        return 0;
 }
 
@@ -322,6 +321,8 @@ static int f81232_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, priv);
 
+       port->port.drain_delay = 256;
+
        return 0;
 }
 
index 60054e72b75ba1fc015a7d6fb778b02f104aae9d..d43adc08283c0611fbac68d37bfd9102986048cb 100644 (file)
@@ -1872,8 +1872,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
 
        ++edge_serial->num_ports_open;
 
-       port->port.drain_delay = 1;
-
        goto release_es_lock;
 
 unlink_int_urb:
@@ -2473,6 +2471,7 @@ static int edge_port_probe(struct usb_serial_port *port)
        }
 
        port->port.closing_wait = msecs_to_jiffies(closing_wait * 10);
+       port->port.drain_delay = 1;
 
        return 0;
 }
index cf509c8c1aa1a6f347f820e314723d3457e8ce54..baa2ea59b92108d51737078ec0a7ab183e77d28e 100644 (file)
@@ -343,6 +343,8 @@ static int oti6858_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, priv);
 
+       port->port.drain_delay = 256;   /* FIXME: check the FIFO length */
+
        return 0;
 }
 
@@ -558,7 +560,7 @@ static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
        /* setup termios */
        if (tty)
                oti6858_set_termios(tty, port, &tmp_termios);
-       port->port.drain_delay = 256;   /* FIXME: check the FIFO length */
+
        return 0;
 }
 
index cb6bbed374f26ffd25b69442bc8fcd9356b8889d..ed9edb2e18497a83ac804495f4ce31b39929263d 100644 (file)
@@ -235,6 +235,8 @@ static int pl2303_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, priv);
 
+       port->port.drain_delay = 256;
+
        return 0;
 }
 
@@ -521,7 +523,6 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
                return result;
        }
 
-       port->port.drain_delay = 256;
        return 0;
 }
 
index ddf6c47137dc4e557630b70156ad146f82d441c7..4abac28b5992a1f128005f5f7df103118a39b081 100644 (file)
@@ -169,6 +169,8 @@ static int spcp8x5_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, priv);
 
+       port->port.drain_delay = 256;
+
        return 0;
 }
 
@@ -411,8 +413,6 @@ static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port)
        if (tty)
                spcp8x5_set_termios(tty, port, NULL);
 
-       port->port.drain_delay = 256;
-
        return usb_serial_generic_open(tty, port);
 }
 
index 7182bb774b7958f70f50efb823b084c5ea9284d5..18db7b3e52b7fba1b19571a439113e52d799965e 100644 (file)
@@ -441,6 +441,8 @@ static int ti_port_probe(struct usb_serial_port *port)
 
        usb_set_serial_port_data(port, tport);
 
+       port->port.drain_delay = 3;
+
        return 0;
 }
 
@@ -582,8 +584,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
        tport->tp_is_open = 1;
        ++tdev->td_open_port_count;
 
-       port->port.drain_delay = 3;
-
        goto release_lock;
 
 unlink_int_urb: