Merge tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[pandora-kernel.git] / drivers / staging / serqt_usb2 / serqt_usb2.c
index 376269b..099bc69 100644 (file)
@@ -245,7 +245,6 @@ static void ProcessLineStatus(struct quatech_port *qt_port,
        qt_port->shadowLSR =
            line_status & (SERIAL_LSR_OE | SERIAL_LSR_PE | SERIAL_LSR_FE |
                           SERIAL_LSR_BI);
-       return;
 }
 
 static void ProcessModemStatus(struct quatech_port *qt_port,
@@ -254,7 +253,6 @@ static void ProcessModemStatus(struct quatech_port *qt_port,
 
        qt_port->shadowMSR = modem_status;
        wake_up_interruptible(&qt_port->wait);
-       return;
 }
 
 static void ProcessRxChar(struct tty_struct *tty, struct usb_serial_port *port,
@@ -358,7 +356,7 @@ static void qt_read_bulk_callback(struct urb *urb)
                goto exit;
        }
 
-       if (tty && RxCount) {
+       if (RxCount) {
                flag_data = 0;
                for (i = 0; i < RxCount; ++i) {
                        /* Look ahead code here */
@@ -422,7 +420,7 @@ static void qt_read_bulk_callback(struct urb *urb)
                dev_dbg(&port->dev, "%s - failed resubmitting read urb, error %d",
                        __func__, result);
        else {
-               if (tty && RxCount) {
+               if (RxCount) {
                        tty_flip_buffer_push(tty);
                        tty_schedule_flip(tty);
                }
@@ -883,8 +881,6 @@ static int qt_open(struct tty_struct *tty,
         * Put this here to make it responsive to stty and defaults set by
         * the tty layer
         */
-       /* FIXME: is this needed? */
-       /* qt_set_termios(tty, port, NULL); */
 
        /*  Check to see if we've set up our endpoint info yet */
        if (port0->open_ports == 1) {
@@ -1175,7 +1171,7 @@ static void qt_set_termios(struct tty_struct *tty,
                           struct usb_serial_port *port,
                           struct ktermios *old_termios)
 {
-       struct ktermios *termios = tty->termios;
+       struct ktermios *termios = &tty->termios;
        unsigned char new_LCR = 0;
        unsigned int cflag = termios->c_cflag;
        unsigned int index;
@@ -1184,7 +1180,7 @@ static void qt_set_termios(struct tty_struct *tty,
 
        index = tty->index - port->serial->minor;
 
-       switch (cflag) {
+       switch (cflag & CSIZE) {
        case CS5:
                new_LCR |= SERIAL_5_DATA;
                break;
@@ -1195,6 +1191,8 @@ static void qt_set_termios(struct tty_struct *tty,
                new_LCR |= SERIAL_7_DATA;
                break;
        default:
+               termios->c_cflag &= ~CSIZE;
+               termios->c_cflag |= CS8;
        case CS8:
                new_LCR |= SERIAL_8_DATA;
                break;
@@ -1279,7 +1277,7 @@ static void qt_set_termios(struct tty_struct *tty,
                        dev_dbg(&port->dev, "BoxSetSW_FlowCtrl (diabling) failed\n");
 
        }
-       tty->termios->c_cflag &= ~CMSPAR;
+       termios->c_cflag &= ~CMSPAR;
        /* FIXME: Error cases should be returning the actual bits changed only */
 }
 
@@ -1390,7 +1388,7 @@ static int qt_tiocmget(struct tty_struct *tty)
        struct usb_serial_port *port = tty->driver_data;
        struct usb_serial *serial = get_usb_serial(port, __func__);
        struct quatech_port *qt_port = qt_get_port_private(port);
-       int retval = -ENODEV;
+       int retval;
 
        if (!serial)
                return -ENODEV;
@@ -1408,7 +1406,7 @@ static int qt_tiocmset(struct tty_struct *tty,
        struct usb_serial_port *port = tty->driver_data;
        struct usb_serial *serial = get_usb_serial(port, __func__);
        struct quatech_port *qt_port = qt_get_port_private(port);
-       int retval = -ENODEV;
+       int retval;
 
        if (!serial)
                return -ENODEV;
@@ -1436,7 +1434,6 @@ static void qt_throttle(struct tty_struct *tty)
        qt_port->RxHolding = 1;
 
        mutex_unlock(&qt_port->lock);
-       return;
 }
 
 static void qt_unthrottle(struct tty_struct *tty)
@@ -1477,8 +1474,6 @@ static void qt_unthrottle(struct tty_struct *tty)
                }
        }
        mutex_unlock(&qt_port->lock);
-       return;
-
 }
 
 static int qt_calc_num_ports(struct usb_serial *serial)