return result;
 }
 
-static int ark3116_get_serial_info(struct tty_struct *tty,
+static void ark3116_get_serial_info(struct tty_struct *tty,
                        struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static int ark3116_tiocmget(struct tty_struct *tty)
 
        return 0;
 }
 
-static int f81232_get_serial_info(struct tty_struct *tty,
-               struct serial_struct *ss)
+static void f81232_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct f81232_private *priv = usb_get_serial_port_data(port);
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = priv->baud_base;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void  f81232_interrupt_work(struct work_struct *work)
        .close =                f81232_close,
        .dtr_rts =              f81232_dtr_rts,
        .carrier_raised =       f81232_carrier_raised,
-       .get_serial =           f81232_get_serial_info,
+       .get_serial =           f81232_get_serial,
        .break_ctl =            f81232_break_ctl,
        .set_termios =          f81232_set_termios,
        .tiocmget =             f81232_tiocmget,
        .close =                f81232_close,
        .dtr_rts =              f81232_dtr_rts,
        .carrier_raised =       f81232_carrier_raised,
-       .get_serial =           f81232_get_serial_info,
+       .get_serial =           f81232_get_serial,
        .break_ctl =            f81232_break_ctl,
        .set_termios =          f81232_set_termios,
        .tiocmget =             f81232_tiocmget,
 
        mutex_unlock(&serial_priv->urb_mutex);
 }
 
-static int f81534_get_serial_info(struct tty_struct *tty,
-                                 struct serial_struct *ss)
+static void f81534_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct f81534_port_private *port_priv;
        port_priv = usb_get_serial_port_data(port);
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = port_priv->baud_base;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void f81534_process_per_serial_block(struct usb_serial_port *port,
 
                        unsigned int set, unsigned int clear);
 static int  ftdi_ioctl(struct tty_struct *tty,
                        unsigned int cmd, unsigned long arg);
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss);
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss);
 static int set_serial_info(struct tty_struct *tty,
                                struct serial_struct *ss);
 static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct ftdi_private *priv = usb_get_serial_port_data(port);
 
-       ss->line = port->minor;
        ss->flags = priv->flags;
        ss->baud_base = priv->baud_base;
        ss->custom_divisor = priv->custom_divisor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static int set_serial_info(struct tty_struct *tty,
 
        return result;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 
 
        return result;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-       unsigned cwait;
-
-       cwait = port->port.closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = jiffies_to_msecs(cwait) / 10;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = cwait;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static void edge_break(struct tty_struct *tty, int break_state)
 
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static int mos7720_ioctl(struct tty_struct *tty,
 
  *      function to get information about serial port
  *****************************************************************************/
 
-static int mos7840_get_serial_info(struct tty_struct *tty,
-                                  struct serial_struct *ss)
+static void mos7840_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16550A;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 /*****************************************************************************
 
        return 0;
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
+static void get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        /* fake emulate a 16550 uart to make userspace code happy */
-       ss->type                = PORT_16550A;
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
+       ss->type = PORT_16550A;
 }
 
 static int opticon_port_probe(struct usb_serial_port *port)
 
        .chars_in_buffer   = usb_wwan_chars_in_buffer,
        .tiocmget          = usb_wwan_tiocmget,
        .tiocmset          = usb_wwan_tiocmset,
-       .get_serial        = usb_wwan_get_serial_info,
-       .set_serial        = usb_wwan_set_serial_info,
        .attach            = option_attach,
        .release           = option_release,
        .port_probe        = usb_wwan_port_probe,
 
        return 0;
 }
 
-static int pl2303_get_serial(struct tty_struct *tty,
-                       struct serial_struct *ss)
+static void pl2303_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 static void pl2303_set_break(struct usb_serial_port *port, bool enable)
 
        usb_kill_urb(serial_priv->read_urb);
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
-}
-
 static void qt2_process_status(struct usb_serial_port *port, unsigned char *ch)
 {
        switch (*ch) {
        .tiocmset            = qt2_tiocmset,
        .tiocmiwait          = usb_serial_generic_tiocmiwait,
        .get_icount          = usb_serial_generic_get_icount,
-       .get_serial          = get_serial_info,
        .set_termios         = qt2_set_termios,
 };
 
 
        return usb_serial_generic_open(tty, port);
 }
 
-static int get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line                = port->minor;
-       ss->close_delay         = 50;
-       ss->closing_wait        = 3000;
-
-       return 0;
-}
-
 static int ssu100_attach(struct usb_serial *serial)
 {
        return ssu100_initdevice(serial->dev);
        .tiocmset            = ssu100_tiocmset,
        .tiocmiwait          = usb_serial_generic_tiocmiwait,
        .get_icount          = usb_serial_generic_get_icount,
-       .get_serial          = get_serial_info,
        .set_termios         = ssu100_set_termios,
 };
 
 
 static void ti_send(struct ti_port *tport);
 static int ti_set_mcr(struct ti_port *tport, unsigned int mcr);
 static int ti_get_lsr(struct ti_port *tport, u8 *lsr);
-static int ti_get_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss);
-static int ti_set_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss);
+static void ti_get_serial_info(struct tty_struct *tty, struct serial_struct *ss);
 static void ti_handle_new_msr(struct ti_port *tport, u8 msr);
 
 static void ti_stop_read(struct ti_port *tport, struct tty_struct *tty);
        .throttle               = ti_throttle,
        .unthrottle             = ti_unthrottle,
        .get_serial             = ti_get_serial_info,
-       .set_serial             = ti_set_serial_info,
        .set_termios            = ti_set_termios,
        .tiocmget               = ti_tiocmget,
        .tiocmset               = ti_tiocmset,
        .throttle               = ti_throttle,
        .unthrottle             = ti_unthrottle,
        .get_serial             = ti_get_serial_info,
-       .set_serial             = ti_set_serial_info,
        .set_termios            = ti_set_termios,
        .tiocmget               = ti_tiocmget,
        .tiocmset               = ti_tiocmset,
 }
 
 
-static int ti_get_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss)
+static void ti_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
        struct ti_port *tport = usb_get_serial_port_data(port);
-       unsigned cwait;
-
-       cwait = port->port.closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = jiffies_to_msecs(cwait) / 10;
 
        ss->type = PORT_16550A;
-       ss->line = port->minor;
        ss->baud_base = tport->tp_tdev->td_is_3410 ? 921600 : 460800;
-       ss->close_delay = 50;
-       ss->closing_wait = cwait;
-
-       return 0;
-}
-
-
-static int ti_set_serial_info(struct tty_struct *tty,
-       struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-       struct tty_port *tport = &port->port;
-       unsigned cwait;
-
-       cwait = ss->closing_wait;
-       if (cwait != ASYNC_CLOSING_WAIT_NONE)
-               cwait = msecs_to_jiffies(10 * ss->closing_wait);
-
-       if (!capable(CAP_SYS_ADMIN)) {
-               if (cwait != tport->closing_wait)
-                       return -EPERM;
-       }
-
-       tport->closing_wait = cwait;
-
-       return 0;
 }
 
 
 
 static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
+       struct tty_port *tport = &port->port;
+       unsigned int close_delay, closing_wait;
+
+       mutex_lock(&tport->mutex);
+
+       close_delay = jiffies_to_msecs(tport->close_delay) / 10;
+       closing_wait = tport->closing_wait;
+       if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
+               closing_wait = jiffies_to_msecs(closing_wait) / 10;
+
+       ss->line = port->minor;
+       ss->close_delay = close_delay;
+       ss->closing_wait = closing_wait;
 
        if (port->serial->type->get_serial)
-               return port->serial->type->get_serial(tty, ss);
-       return -ENOTTY;
+               port->serial->type->get_serial(tty, ss);
+
+       mutex_unlock(&tport->mutex);
+
+       return 0;
 }
 
 static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
        struct usb_serial_port *port = tty->driver_data;
+       struct tty_port *tport = &port->port;
+       unsigned int close_delay, closing_wait;
+       int ret = 0;
+
+       close_delay = msecs_to_jiffies(ss->close_delay * 10);
+       closing_wait = ss->closing_wait;
+       if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
+               closing_wait = msecs_to_jiffies(closing_wait * 10);
+
+       mutex_lock(&tport->mutex);
+
+       if (!capable(CAP_SYS_ADMIN)) {
+               if (close_delay != tport->close_delay ||
+                               closing_wait != tport->closing_wait) {
+                       ret = -EPERM;
+                       goto out_unlock;
+               }
+       }
 
-       if (port->serial->type->set_serial)
-               return port->serial->type->set_serial(tty, ss);
-       return -ENOTTY;
+       if (port->serial->type->set_serial) {
+               ret = port->serial->type->set_serial(tty, ss);
+               if (ret)
+                       goto out_unlock;
+       }
+
+       tport->close_delay = close_delay;
+       tport->closing_wait = closing_wait;
+out_unlock:
+       mutex_unlock(&tport->mutex);
+
+       return ret;
 }
 
 static int serial_ioctl(struct tty_struct *tty,
 
 extern int usb_wwan_tiocmget(struct tty_struct *tty);
 extern int usb_wwan_tiocmset(struct tty_struct *tty,
                             unsigned int set, unsigned int clear);
-extern int usb_wwan_get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss);
-extern int usb_wwan_set_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss);
 extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
                          const unsigned char *buf, int count);
 extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
 
 }
 EXPORT_SYMBOL(usb_wwan_tiocmset);
 
-int usb_wwan_get_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-
-       ss->line            = port->minor;
-       ss->close_delay     = jiffies_to_msecs(port->port.close_delay) / 10;
-       ss->closing_wait    = port->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-                                ASYNC_CLOSING_WAIT_NONE :
-                                jiffies_to_msecs(port->port.closing_wait) / 10;
-       return 0;
-}
-EXPORT_SYMBOL(usb_wwan_get_serial_info);
-
-int usb_wwan_set_serial_info(struct tty_struct *tty,
-                          struct serial_struct *ss)
-{
-       struct usb_serial_port *port = tty->driver_data;
-       unsigned int closing_wait, close_delay;
-       int retval = 0;
-
-       close_delay = msecs_to_jiffies(ss->close_delay * 10);
-       closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-                       ASYNC_CLOSING_WAIT_NONE :
-                       msecs_to_jiffies(ss->closing_wait * 10);
-
-       mutex_lock(&port->port.mutex);
-
-       if (!capable(CAP_SYS_ADMIN)) {
-               if ((close_delay != port->port.close_delay) ||
-                   (closing_wait != port->port.closing_wait))
-                       retval = -EPERM;
-       } else {
-               port->port.close_delay  = close_delay;
-               port->port.closing_wait = closing_wait;
-       }
-
-       mutex_unlock(&port->port.mutex);
-       return retval;
-}
-EXPORT_SYMBOL(usb_wwan_set_serial_info);
-
 int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
                   const unsigned char *buf, int count)
 {
 
 static int  whiteheat_open(struct tty_struct *tty,
                        struct usb_serial_port *port);
 static void whiteheat_close(struct usb_serial_port *port);
-static int  whiteheat_get_serial(struct tty_struct *tty,
+static void whiteheat_get_serial(struct tty_struct *tty,
                        struct serial_struct *ss);
 static void whiteheat_set_termios(struct tty_struct *tty,
                        struct usb_serial_port *port, struct ktermios *old);
 }
 
 
-static int whiteheat_get_serial(struct tty_struct *tty,
-                               struct serial_struct *ss)
+static void whiteheat_get_serial(struct tty_struct *tty, struct serial_struct *ss)
 {
-       struct usb_serial_port *port = tty->driver_data;
-
        ss->type = PORT_16654;
-       ss->line = port->minor;
        ss->baud_base = 460800;
-       ss->close_delay = 50;
-       ss->closing_wait = 3000;
-
-       return 0;
 }
 
 
 
        int  (*write_room)(struct tty_struct *tty);
        int  (*ioctl)(struct tty_struct *tty,
                      unsigned int cmd, unsigned long arg);
-       int  (*get_serial)(struct tty_struct *tty, struct serial_struct *ss);
+       void (*get_serial)(struct tty_struct *tty, struct serial_struct *ss);
        int  (*set_serial)(struct tty_struct *tty, struct serial_struct *ss);
        void (*set_termios)(struct tty_struct *tty,
                        struct usb_serial_port *port, struct ktermios *old);