Commit 8fbde798 authored by Al Viro's avatar Al Viro

quatech2: switch to ->get_serial()

Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9326ec59
...@@ -453,39 +453,19 @@ static void qt2_disconnect(struct usb_serial *serial) ...@@ -453,39 +453,19 @@ static void qt2_disconnect(struct usb_serial *serial)
usb_kill_urb(serial_priv->read_urb); usb_kill_urb(serial_priv->read_urb);
} }
static int get_serial_info(struct usb_serial_port *port, static int get_serial_info(struct tty_struct *tty,
struct serial_struct __user *retinfo) struct serial_struct *ss)
{
struct serial_struct tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.line = port->minor;
tmp.port = 0;
tmp.irq = 0;
tmp.xmit_fifo_size = port->bulk_out_size;
tmp.baud_base = 9600;
tmp.close_delay = 5*HZ;
tmp.closing_wait = 30*HZ;
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
return -EFAULT;
return 0;
}
static int qt2_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
switch (cmd) { ss->line = port->minor;
case TIOCGSERIAL: ss->port = 0;
return get_serial_info(port, ss->irq = 0;
(struct serial_struct __user *)arg); ss->xmit_fifo_size = port->bulk_out_size;
default: ss->baud_base = 9600;
break; ss->close_delay = 5*HZ;
} ss->closing_wait = 30*HZ;
return 0;
return -ENOIOCTLCMD;
} }
static void qt2_process_status(struct usb_serial_port *port, unsigned char *ch) static void qt2_process_status(struct usb_serial_port *port, unsigned char *ch)
...@@ -1013,7 +993,7 @@ static struct usb_serial_driver qt2_device = { ...@@ -1013,7 +993,7 @@ static struct usb_serial_driver qt2_device = {
.tiocmset = qt2_tiocmset, .tiocmset = qt2_tiocmset,
.tiocmiwait = usb_serial_generic_tiocmiwait, .tiocmiwait = usb_serial_generic_tiocmiwait,
.get_icount = usb_serial_generic_get_icount, .get_icount = usb_serial_generic_get_icount,
.ioctl = qt2_ioctl, .get_serial = get_serial_info,
.set_termios = qt2_set_termios, .set_termios = qt2_set_termios,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment