From: Tollef Fog Heen Date: Fri, 12 Sep 2008 11:56:51 +0000 (+0200) Subject: Temporary commit X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f2065cf0f3d151d8e8e1aa563519325bc424be0;p=linux-2.6 Temporary commit --- diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 3b913a17df..b85bd0ec1b 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -361,7 +361,8 @@ error: kfree(priv); return r; } -static void ch341_close(struct usb_serial_port *port, struct file *filp) +static void ch341_close(struct tty_struct *tty, struct usb_serial_port *port, + struct file *filp) { struct ch341_private *priv = usb_get_serial_port_data(port); unsigned long flags; @@ -375,8 +376,8 @@ static void ch341_close(struct usb_serial_port *port, struct file *filp) usb_kill_urb(port->read_urb); usb_kill_urb(port->interrupt_in_urb); - if (port->tty) { - c_cflag = port->tty->termios->c_cflag; + if (tty) { + c_cflag = tty->termios->c_cflag; if (c_cflag & HUPCL) { /* drop DTR and RTS */ spin_lock_irqsave(&priv->lock, flags); @@ -420,7 +421,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port, if (r) { dev_err(&port->dev, "%s - failed submitting interrupt urb," " error %d\n", __func__, r); - ch341_close(port, NULL); + ch341_close(tty, port, NULL); return -EPROTO; } @@ -468,9 +469,10 @@ static void ch341_set_termios(struct tty_struct *tty, */ } -static int ch341_tiocmset(struct usb_serial_port *port, struct file *file, +static int ch341_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear) { + struct usb_serial_port *port = tty->driver_data; struct ch341_private *priv = usb_get_serial_port_data(port); unsigned long flags; u8 control; @@ -578,9 +580,10 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg) return 0; } -static int ch341_ioctl(struct usb_serial_port *port, struct file *file, +static int ch341_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { + struct usb_serial_port *port = tty->driver_data; dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd); switch (cmd) { @@ -596,8 +599,9 @@ static int ch341_ioctl(struct usb_serial_port *port, struct file *file, return -ENOIOCTLCMD; } -static int ch341_tiocmget(struct usb_serial_port *port, struct file *file) +static int ch341_tiocmget(struct tty_struct *tty, struct file *file) { + struct usb_serial_port *port = tty->driver_data; struct ch341_private *priv = usb_get_serial_port_data(port); unsigned long flags; u8 mcr; @@ -655,9 +659,11 @@ static struct usb_serial_driver ch341_device = { }, .id_table = id_table, .usb_driver = &ch341_driver, + /* .num_interrupt_in = 1, .num_bulk_in = 1, .num_bulk_out = 1, + */ .num_ports = 1, .open = ch341_open, .close = ch341_close,