From: Tollef Fog Heen Date: Sat, 30 Aug 2008 20:38:57 +0000 (+0200) Subject: Merge commit 'origin/master' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5c9ddc8f932067fc38c85445d950425886e6698;p=linux-2.6 Merge commit 'origin/master' Conflicts: drivers/usb/serial/ch341.c --- f5c9ddc8f932067fc38c85445d950425886e6698 diff --cc drivers/usb/serial/ch341.c index c1560192f8,f61e3ca643..3b913a17df --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@@ -361,36 -231,9 +361,37 @@@ error: kfree(priv) return r; } +static void ch341_close(struct usb_serial_port *port, struct file *filp) +{ + struct ch341_private *priv = usb_get_serial_port_data(port); + unsigned long flags; + unsigned int c_cflag; + + dbg("%s - port %d", __func__, port->number); + + /* shutdown our urbs */ + dbg("%s - shutting down urbs", __func__); + usb_kill_urb(port->write_urb); + usb_kill_urb(port->read_urb); + usb_kill_urb(port->interrupt_in_urb); + + if (port->tty) { + c_cflag = port->tty->termios->c_cflag; + if (c_cflag & HUPCL) { + /* drop DTR and RTS */ + spin_lock_irqsave(&priv->lock, flags); + priv->line_control = 0; + spin_unlock_irqrestore(&priv->lock, flags); + ch341_set_handshake(port->serial->dev, 0); + } + } + wake_up_interruptible(&priv->delta_msr_wait); +} + + /* open this device, set default parameters */ - static int ch341_open(struct usb_serial_port *port, struct file *filp) + static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port, + struct file *filp) { struct usb_serial *serial = port->serial; struct ch341_private *priv = usb_get_serial_port_data(serial->port[0]); @@@ -413,17 -257,7 +414,17 @@@ if (r) goto out; + dbg("%s - submitting interrupt urb", __func__); + port->interrupt_in_urb->dev = serial->dev; + r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); + if (r) { + dev_err(&port->dev, "%s - failed submitting interrupt urb," + " error %d\n", __func__, r); + ch341_close(port, NULL); + return -EPROTO; + } + - r = usb_serial_generic_open(port, filp); + r = usb_serial_generic_open(tty, port, filp); out: return r; } @@@ -431,13 -265,11 +432,12 @@@ /* Old_termios contains the original termios settings and * tty->termios contains the new setting to be used. */ - static void ch341_set_termios(struct usb_serial_port *port, - struct ktermios *old_termios) + static void ch341_set_termios(struct tty_struct *tty, + struct usb_serial_port *port, struct ktermios *old_termios) { struct ch341_private *priv = usb_get_serial_port_data(port); - struct tty_struct *tty = port->tty; unsigned baud_rate; + unsigned long flags; dbg("ch341_set_termios()");