Commit 30296aa4 authored by Al Viro's avatar Al Viro

opticon: switch to ->get_serial()

Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b27ef409
...@@ -328,42 +328,23 @@ static int opticon_tiocmset(struct tty_struct *tty, ...@@ -328,42 +328,23 @@ static int opticon_tiocmset(struct tty_struct *tty,
return 0; return 0;
} }
static int get_serial_info(struct usb_serial_port *port, static int get_serial_info(struct tty_struct *tty,
struct serial_struct __user *serial) struct serial_struct *ss)
{ {
struct serial_struct tmp; struct usb_serial_port *port = tty->driver_data;
memset(&tmp, 0x00, sizeof(tmp));
/* fake emulate a 16550 uart to make userspace code happy */ /* fake emulate a 16550 uart to make userspace code happy */
tmp.type = PORT_16550A; ss->type = PORT_16550A;
tmp.line = port->minor; ss->line = port->minor;
tmp.port = 0; ss->port = 0;
tmp.irq = 0; ss->irq = 0;
tmp.xmit_fifo_size = 1024; ss->xmit_fifo_size = 1024;
tmp.baud_base = 9600; ss->baud_base = 9600;
tmp.close_delay = 5*HZ; ss->close_delay = 5*HZ;
tmp.closing_wait = 30*HZ; ss->closing_wait = 30*HZ;
if (copy_to_user(serial, &tmp, sizeof(*serial)))
return -EFAULT;
return 0; return 0;
} }
static int opticon_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct usb_serial_port *port = tty->driver_data;
switch (cmd) {
case TIOCGSERIAL:
return get_serial_info(port,
(struct serial_struct __user *)arg);
}
return -ENOIOCTLCMD;
}
static int opticon_port_probe(struct usb_serial_port *port) static int opticon_port_probe(struct usb_serial_port *port)
{ {
struct opticon_private *priv; struct opticon_private *priv;
...@@ -404,7 +385,7 @@ static struct usb_serial_driver opticon_device = { ...@@ -404,7 +385,7 @@ static struct usb_serial_driver opticon_device = {
.write_room = opticon_write_room, .write_room = opticon_write_room,
.throttle = usb_serial_generic_throttle, .throttle = usb_serial_generic_throttle,
.unthrottle = usb_serial_generic_unthrottle, .unthrottle = usb_serial_generic_unthrottle,
.ioctl = opticon_ioctl, .get_serial = get_serial_info,
.tiocmget = opticon_tiocmget, .tiocmget = opticon_tiocmget,
.tiocmset = opticon_tiocmset, .tiocmset = opticon_tiocmset,
.process_read_urb = opticon_process_read_urb, .process_read_urb = opticon_process_read_urb,
......
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