summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mos7720.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r--drivers/usb/serial/mos7720.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index f27c621a929..51da424327b 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1047,7 +1047,7 @@ static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port)
*
* 0x08 : SP1/2 Control Reg
*/
- port_number = port->number - port->serial->minor;
+ port_number = port->port_number;
read_mos_reg(serial, port_number, LSR, &data);
dev_dbg(&port->dev, "SS::%p LSR:%x\n", mos7720_port, data);
@@ -1066,7 +1066,7 @@ static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port)
write_mos_reg(serial, port_number, SP_CONTROL_REG, 0x00);
read_mos_reg(serial, dummy, SP_CONTROL_REG, &data);
- data = data | (port->number - port->serial->minor + 1);
+ data = data | (port->port_number + 1);
write_mos_reg(serial, dummy, SP_CONTROL_REG, data);
mos7720_port->shadowLCR = 0x83;
write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
@@ -1147,8 +1147,8 @@ static void mos7720_close(struct usb_serial_port *port)
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);
- write_mos_reg(serial, port->number - port->serial->minor, MCR, 0x00);
- write_mos_reg(serial, port->number - port->serial->minor, IER, 0x00);
+ write_mos_reg(serial, port->port_number, MCR, 0x00);
+ write_mos_reg(serial, port->port_number, IER, 0x00);
mos7720_port->open = 0;
}
@@ -1172,8 +1172,7 @@ static void mos7720_break(struct tty_struct *tty, int break_state)
data = mos7720_port->shadowLCR & ~UART_LCR_SBC;
mos7720_port->shadowLCR = data;
- write_mos_reg(serial, port->number - port->serial->minor,
- LCR, mos7720_port->shadowLCR);
+ write_mos_reg(serial, port->port_number, LCR, mos7720_port->shadowLCR);
}
/*
@@ -1304,8 +1303,8 @@ static void mos7720_throttle(struct tty_struct *tty)
/* if we are implementing RTS/CTS, toggle that line */
if (tty->termios.c_cflag & CRTSCTS) {
mos7720_port->shadowMCR &= ~UART_MCR_RTS;
- write_mos_reg(port->serial, port->number - port->serial->minor,
- MCR, mos7720_port->shadowMCR);
+ write_mos_reg(port->serial, port->port_number, MCR,
+ mos7720_port->shadowMCR);
if (status != 0)
return;
}
@@ -1336,8 +1335,8 @@ static void mos7720_unthrottle(struct tty_struct *tty)
/* if we are implementing RTS/CTS, toggle that line */
if (tty->termios.c_cflag & CRTSCTS) {
mos7720_port->shadowMCR |= UART_MCR_RTS;
- write_mos_reg(port->serial, port->number - port->serial->minor,
- MCR, mos7720_port->shadowMCR);
+ write_mos_reg(port->serial, port->port_number, MCR,
+ mos7720_port->shadowMCR);
if (status != 0)
return;
}
@@ -1361,7 +1360,7 @@ static int set_higher_rates(struct moschip_port *mos7720_port,
* Init Sequence for higher rates
***********************************************/
dev_dbg(&port->dev, "Sending Setting Commands ..........\n");
- port_number = port->number - port->serial->minor;
+ port_number = port->port_number;
write_mos_reg(serial, port_number, IER, 0x00);
write_mos_reg(serial, port_number, FCR, 0x00);
@@ -1487,7 +1486,7 @@ static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port,
port = mos7720_port->port;
serial = port->serial;
- number = port->number - port->serial->minor;
+ number = port->port_number;
dev_dbg(&port->dev, "%s - baud = %d\n", __func__, baudrate);
/* Calculate the Divisor */
@@ -1538,7 +1537,7 @@ static void change_port_settings(struct tty_struct *tty,
port = mos7720_port->port;
serial = port->serial;
- port_number = port->number - port->serial->minor;
+ port_number = port->port_number;
if (!mos7720_port->open) {
dev_dbg(&port->dev, "%s - port not opened\n", __func__);
@@ -1731,7 +1730,7 @@ static int get_lsr_info(struct tty_struct *tty,
struct usb_serial_port *port = tty->driver_data;
unsigned int result = 0;
unsigned char data = 0;
- int port_number = port->number - port->serial->minor;
+ int port_number = port->port_number;
int count;
count = mos7720_chars_in_buffer(tty);
@@ -1793,8 +1792,8 @@ static int mos7720_tiocmset(struct tty_struct *tty,
mcr &= ~UART_MCR_LOOP;
mos7720_port->shadowMCR = mcr;
- write_mos_reg(port->serial, port->number - port->serial->minor,
- MCR, mos7720_port->shadowMCR);
+ write_mos_reg(port->serial, port->port_number, MCR,
+ mos7720_port->shadowMCR);
return 0;
}
@@ -1838,8 +1837,8 @@ static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd,
}
mos7720_port->shadowMCR = mcr;
- write_mos_reg(port->serial, port->number - port->serial->minor,
- MCR, mos7720_port->shadowMCR);
+ write_mos_reg(port->serial, port->port_number, MCR,
+ mos7720_port->shadowMCR);
return 0;
}
@@ -1855,8 +1854,8 @@ static int get_serial_info(struct moschip_port *mos7720_port,
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_16550A;
- tmp.line = mos7720_port->port->serial->minor;
- tmp.port = mos7720_port->port->number;
+ tmp.line = mos7720_port->port->minor;
+ tmp.port = mos7720_port->port->port_number;
tmp.irq = 0;
tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
tmp.xmit_fifo_size = NUM_URBS * URB_TRANSFER_BUFFER_SIZE;