Merge tag 'staging-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / serqt_usb2 / serqt_usb2.c
index 39de5e021ccbc8646ec01c62bb952f66691e69b0..73fc3cc19e332ccd8d800fc6d4744f07c016cb30 100644 (file)
@@ -873,7 +873,7 @@ static int qt_open(struct tty_struct *tty,
        result = qt_get_device(serial, &port0->device_data);
 
        /* Port specific setups */
-       result = qt_open_channel(serial, port->number, &channel_data);
+       result = qt_open_channel(serial, port->port_number, &channel_data);
        if (result < 0) {
                dev_dbg(&port->dev, "qt_open_channel failed\n");
                return result;
@@ -888,7 +888,7 @@ static int qt_open(struct tty_struct *tty,
            (SERIAL_MSR_CTS | SERIAL_MSR_DSR | SERIAL_MSR_RI | SERIAL_MSR_CD);
 
        /* Set Baud rate to default and turn off (default)flow control here */
-       result = qt_setuart(serial, port->number, DEFAULT_DIVISOR, DEFAULT_LCR);
+       result = qt_setuart(serial, port->port_number, DEFAULT_DIVISOR, DEFAULT_LCR);
        if (result < 0) {
                dev_dbg(&port->dev, "qt_setuart failed\n");
                return result;
@@ -906,8 +906,7 @@ static int qt_open(struct tty_struct *tty,
                        qt_submit_urb_from_open(serial, port);
        }
 
-       dev_dbg(&port->dev, "port number is %d\n", port->number);
-       dev_dbg(&port->dev, "serial number is %d\n", port->serial->minor);
+       dev_dbg(&port->dev, "minor number is %d\n", port->minor);
        dev_dbg(&port->dev,
                "Bulkin endpoint is %d\n", port->bulk_in_endpointAddress);
        dev_dbg(&port->dev,
@@ -1003,7 +1002,7 @@ static void qt_close(struct usb_serial_port *port)
        status = 0;
 
        tty = tty_port_tty_get(&port->port);
-       index = tty->index - serial->minor;
+       index = port->port_number;
 
        qt_port = qt_get_port_private(port);
        port0 = qt_get_port_private(serial->port[0]);
@@ -1022,14 +1021,11 @@ static void qt_close(struct usb_serial_port *port)
        /* Close uart channel */
        status = qt_close_channel(serial, index);
        if (status < 0)
-               dev_dbg(&port->dev,
-                       "%s - port %d qt_close_channel failed.\n",
-                       __func__, port->number);
+               dev_dbg(&port->dev, "%s - qt_close_channel failed.\n", __func__);
 
        port0->open_ports--;
 
-       dev_dbg(&port->dev, "qt_num_open_ports in close%d:in port%d\n",
-               port0->open_ports, port->number);
+       dev_dbg(&port->dev, "qt_num_open_ports in close%d\n", port0->open_ports);
 
        if (port0->open_ports == 0) {
                if (serial->port[0]->interrupt_in_urb) {
@@ -1133,12 +1129,11 @@ static int qt_ioctl(struct tty_struct *tty,
 {
        struct usb_serial_port *port = tty->driver_data;
        struct quatech_port *qt_port = qt_get_port_private(port);
-       struct usb_serial *serial = get_usb_serial(port, __func__);
        unsigned int index;
 
        dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd);
 
-       index = tty->index - serial->minor;
+       index = port->port_number;
 
        if (cmd == TIOCMIWAIT) {
                while (qt_port != NULL) {
@@ -1169,8 +1164,7 @@ static int qt_ioctl(struct tty_struct *tty,
                return 0;
        }
 
-       dev_dbg(&port->dev, "%s -No ioctl for that one.  port = %d\n",
-               __func__, port->number);
+       dev_dbg(&port->dev, "%s -No ioctl for that one.\n", __func__);
        return -ENOIOCTLCMD;
 }
 
@@ -1185,7 +1179,7 @@ static void qt_set_termios(struct tty_struct *tty,
        int baud, divisor, remainder;
        int status;
 
-       index = tty->index - port->serial->minor;
+       index = port->port_number;
 
        switch (cflag & CSIZE) {
        case CS5:
@@ -1245,8 +1239,7 @@ static void qt_set_termios(struct tty_struct *tty,
 
        /* Now determine flow control */
        if (cflag & CRTSCTS) {
-               dev_dbg(&port->dev, "%s - Enabling HW flow control port %d\n",
-                       __func__, port->number);
+               dev_dbg(&port->dev, "%s - Enabling HW flow control\n", __func__);
 
                /* Enable RTS/CTS flow control */
                status = box_set_hw_flow_ctrl(port->serial, index, 1);
@@ -1258,8 +1251,7 @@ static void qt_set_termios(struct tty_struct *tty,
        } else {
                /* Disable RTS/CTS flow control */
                dev_dbg(&port->dev,
-                       "%s - disabling HW flow control port %d\n",
-                       __func__, port->number);
+                       "%s - disabling HW flow control\n", __func__);
 
                status = box_set_hw_flow_ctrl(port->serial, index, 0);
                if (status < 0) {
@@ -1303,7 +1295,7 @@ static void qt_break(struct tty_struct *tty, int break_state)
        u16 index, onoff;
        unsigned int result;
 
-       index = tty->index - serial->minor;
+       index = port->port_number;
 
        qt_port = qt_get_port_private(port);
 
@@ -1332,7 +1324,7 @@ static inline int qt_real_tiocmget(struct tty_struct *tty,
        int status;
        unsigned int index;
 
-       index = tty->index - serial->minor;
+       index = port->port_number;
        status =
            box_get_register(port->serial, index, MODEM_CONTROL_REGISTER, &mcr);
        if (status >= 0) {
@@ -1371,7 +1363,7 @@ static inline int qt_real_tiocmset(struct tty_struct *tty,
        int status;
        unsigned int index;
 
-       index = tty->index - serial->minor;
+       index = port->port_number;
        status =
            box_get_register(port->serial, index, MODEM_CONTROL_REGISTER, &mcr);
        if (status < 0)