提交 65d063ab 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

USB: mos7720: clean up termios

Remove lots of NULL checks that can no longer occur
Encode the baud rate back into the termios (again someone with docs see
FIXME to improve this further)
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 487dc922
...@@ -1040,11 +1040,6 @@ static void change_port_settings(struct moschip_port *mos7720_port, ...@@ -1040,11 +1040,6 @@ static void change_port_settings(struct moschip_port *mos7720_port,
tty = mos7720_port->port->tty; tty = mos7720_port->port->tty;
if ((!tty) || (!tty->termios)) {
dbg("%s - no tty structures", __FUNCTION__);
return;
}
dbg("%s: Entering ..........", __FUNCTION__); dbg("%s: Entering ..........", __FUNCTION__);
lData = UART_LCR_WLEN8; lData = UART_LCR_WLEN8;
...@@ -1175,7 +1170,10 @@ static void change_port_settings(struct moschip_port *mos7720_port, ...@@ -1175,7 +1170,10 @@ static void change_port_settings(struct moschip_port *mos7720_port,
dbg("%s - baud rate = %d", __FUNCTION__, baud); dbg("%s - baud rate = %d", __FUNCTION__, baud);
status = send_cmd_write_baud_rate(mos7720_port, baud); status = send_cmd_write_baud_rate(mos7720_port, baud);
/* FIXME: needs to write actual resulting baud back not just
blindly do so */
if (cflag & CBAUD)
tty_encode_baud_rate(tty, baud, baud);
/* Enable Interrupts */ /* Enable Interrupts */
data = 0x0c; data = 0x0c;
send_mos_cmd(serial, MOS_WRITE, port_number, UART_IER, &data); send_mos_cmd(serial, MOS_WRITE, port_number, UART_IER, &data);
...@@ -1214,10 +1212,6 @@ static void mos7720_set_termios(struct usb_serial_port *port, ...@@ -1214,10 +1212,6 @@ static void mos7720_set_termios(struct usb_serial_port *port,
tty = port->tty; tty = port->tty;
if (!port->tty || !port->tty->termios) {
dbg("%s - no tty or termios", __FUNCTION__);
return;
}
if (!mos7720_port->open) { if (!mos7720_port->open) {
dbg("%s - port not opened", __FUNCTION__); dbg("%s - port not opened", __FUNCTION__);
...@@ -1228,19 +1222,13 @@ static void mos7720_set_termios(struct usb_serial_port *port, ...@@ -1228,19 +1222,13 @@ static void mos7720_set_termios(struct usb_serial_port *port,
cflag = tty->termios->c_cflag; cflag = tty->termios->c_cflag;
if (!cflag) { dbg("%s - cflag %08x iflag %08x", __FUNCTION__,
printk("%s %s\n",__FUNCTION__,"cflag is NULL");
return;
}
dbg("%s - clfag %08x iflag %08x", __FUNCTION__,
tty->termios->c_cflag, tty->termios->c_cflag,
RELEVANT_IFLAG(tty->termios->c_iflag)); RELEVANT_IFLAG(tty->termios->c_iflag));
if (old_termios) dbg("%s - old cflag %08x old iflag %08x", __FUNCTION__,
dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__, old_termios->c_cflag,
old_termios->c_cflag, RELEVANT_IFLAG(old_termios->c_iflag));
RELEVANT_IFLAG(old_termios->c_iflag));
dbg("%s - port %d", __FUNCTION__, port->number); dbg("%s - port %d", __FUNCTION__, port->number);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册