Commit 056abede authored by Al Viro's avatar Al Viro

f81232: switch to ->get_serial()

Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent aadcd0a1
...@@ -583,36 +583,16 @@ static int f81232_carrier_raised(struct usb_serial_port *port) ...@@ -583,36 +583,16 @@ static int f81232_carrier_raised(struct usb_serial_port *port)
return 0; return 0;
} }
static int f81232_get_serial_info(struct usb_serial_port *port, static int f81232_get_serial_info(struct tty_struct *tty,
unsigned long arg) struct serial_struct *ss)
{
struct serial_struct ser;
memset(&ser, 0, sizeof(ser));
ser.type = PORT_16550A;
ser.line = port->minor;
ser.port = port->port_number;
ser.baud_base = F81232_MAX_BAUDRATE;
if (copy_to_user((void __user *)arg, &ser, sizeof(ser)))
return -EFAULT;
return 0;
}
static int f81232_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->type = PORT_16550A;
case TIOCGSERIAL: ss->line = port->minor;
return f81232_get_serial_info(port, arg); ss->port = port->port_number;
default: ss->baud_base = F81232_MAX_BAUDRATE;
break; return 0;
}
return -ENOIOCTLCMD;
} }
static void f81232_interrupt_work(struct work_struct *work) static void f81232_interrupt_work(struct work_struct *work)
...@@ -665,7 +645,7 @@ static struct usb_serial_driver f81232_device = { ...@@ -665,7 +645,7 @@ static struct usb_serial_driver f81232_device = {
.close = f81232_close, .close = f81232_close,
.dtr_rts = f81232_dtr_rts, .dtr_rts = f81232_dtr_rts,
.carrier_raised = f81232_carrier_raised, .carrier_raised = f81232_carrier_raised,
.ioctl = f81232_ioctl, .get_serial = f81232_get_serial_info,
.break_ctl = f81232_break_ctl, .break_ctl = f81232_break_ctl,
.set_termios = f81232_set_termios, .set_termios = f81232_set_termios,
.tiocmget = f81232_tiocmget, .tiocmget = f81232_tiocmget,
......
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