tty: serial - fix tty back references in termios
One or two drivers go poking back into the tty from the termios setting routine in unsafe ways. We don't need to pass the tty down because the [ab]users are just using it to get at things they can get at anyway. This leaves low_latency setting to sort out along with set_ldisc use. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
192251352f
commit
eab4f5af6b
@@ -430,17 +430,14 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
int baud = 0;
|
||||
unsigned cflag;
|
||||
u32 param_new, param_mask, parity = 0;
|
||||
struct tty_struct *tty = s->port.state->port.tty;
|
||||
|
||||
dev_dbg(&s->spi->dev, "%s\n", __func__);
|
||||
if (!tty)
|
||||
return;
|
||||
|
||||
cflag = termios->c_cflag;
|
||||
param_new = 0;
|
||||
param_mask = 0;
|
||||
|
||||
baud = tty_get_baud_rate(tty);
|
||||
baud = tty_termios_baud_rate(termios);
|
||||
param_new = s->conf & MAX3100_BAUD;
|
||||
switch (baud) {
|
||||
case 300:
|
||||
@@ -485,7 +482,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
default:
|
||||
baud = s->baud;
|
||||
}
|
||||
tty_encode_baud_rate(tty, baud, baud);
|
||||
tty_termios_encode_baud_rate(termios, baud, baud);
|
||||
s->baud = baud;
|
||||
param_mask |= MAX3100_BAUD;
|
||||
|
||||
|
Reference in New Issue
Block a user