提交 aadcd0a1 编写于 作者: A Al Viro

ark3116: switch to ->get_serial()

Reviewed-by: NJohan Hovold <johan@kernel.org>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 99f75a1f
......@@ -397,38 +397,16 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
return result;
}
static int ark3116_get_serial_info(struct usb_serial_port *port,
struct serial_struct __user *retinfo)
{
struct serial_struct tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_16654;
tmp.line = port->minor;
tmp.port = port->port_number;
tmp.baud_base = 460800;
if (copy_to_user(retinfo, &tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}
static int ark3116_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
static int ark3116_get_serial_info(struct tty_struct *tty,
struct serial_struct *ss)
{
struct usb_serial_port *port = tty->driver_data;
void __user *user_arg = (void __user *)arg;
switch (cmd) {
case TIOCGSERIAL:
return ark3116_get_serial_info(port, user_arg);
default:
break;
}
return -ENOIOCTLCMD;
ss->type = PORT_16654;
ss->line = port->minor;
ss->port = port->port_number;
ss->baud_base = 460800;
return 0;
}
static int ark3116_tiocmget(struct tty_struct *tty)
......@@ -668,7 +646,7 @@ static struct usb_serial_driver ark3116_device = {
.port_remove = ark3116_port_remove,
.set_termios = ark3116_set_termios,
.init_termios = ark3116_init_termios,
.ioctl = ark3116_ioctl,
.get_serial = ark3116_get_serial_info,
.tiocmget = ark3116_tiocmget,
.tiocmset = ark3116_tiocmset,
.tiocmiwait = usb_serial_generic_tiocmiwait,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册