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;
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);
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;
}
*/
}
-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;
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) {
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;
},
.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,