f81232: switch to ->get_serial()
[muen/linux.git] / drivers / usb / serial / f81232.c
index 96036f87b1dedcbf68de9b2e541c841b0e370678..0dcdcb4b2cde5ecb640218e5aa63265c0ebe2067 100644 (file)
@@ -583,36 +583,16 @@ static int f81232_carrier_raised(struct usb_serial_port *port)
        return 0;
 }
 
-static int f81232_get_serial_info(struct usb_serial_port *port,
-               unsigned long arg)
-{
-       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)
+static int f81232_get_serial_info(struct tty_struct *tty,
+               struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
 
-       switch (cmd) {
-       case TIOCGSERIAL:
-               return f81232_get_serial_info(port, arg);
-       default:
-               break;
-       }
-       return -ENOIOCTLCMD;
+       ss->type = PORT_16550A;
+       ss->line = port->minor;
+       ss->port = port->port_number;
+       ss->baud_base = F81232_MAX_BAUDRATE;
+       return 0;
 }
 
 static void  f81232_interrupt_work(struct work_struct *work)
@@ -665,7 +645,7 @@ static struct usb_serial_driver f81232_device = {
        .close =                f81232_close,
        .dtr_rts =              f81232_dtr_rts,
        .carrier_raised =       f81232_carrier_raised,
-       .ioctl =                f81232_ioctl,
+       .get_serial =           f81232_get_serial_info,
        .break_ctl =            f81232_break_ctl,
        .set_termios =          f81232_set_termios,
        .tiocmget =             f81232_tiocmget,