]> err.no Git - linux-2.6/commitdiff
Merge commit 'origin/master'
authorTollef Fog Heen <tfheen@err.no>
Sat, 30 Aug 2008 20:38:57 +0000 (22:38 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sat, 30 Aug 2008 20:38:57 +0000 (22:38 +0200)
Conflicts:

drivers/usb/serial/ch341.c

1  2 
drivers/usb/serial/ch341.c

index c1560192f8f8bf5c96c55fd11c3884a44d9fb789,f61e3ca64305abb3d7bbefda787c073bb30c77ee..3b913a17df0e7458d028d4f260080948a40543ee
@@@ -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]);
        if (r)
                goto out;
  
-       r = usb_serial_generic_open(port, filp);
 +      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(tty, port, filp);
  
  out:  return r;
  }
  /* 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()");