From: Jiri Slaby Date: Wed, 9 Nov 2011 20:33:44 +0000 (+0100) Subject: TTY: serial, cleanup atmel_set_ldisc X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b54bf3b24908cd4f6a1d24276f795cfbccba5a3f;p=deliverable%2Flinux.git TTY: serial, cleanup atmel_set_ldisc Current ldisc number is passed as a paramneter -- no need to dig it out of the tty or ldisc. So switch PPS check to that. No tty callback can be called with port->line higher than TTY driver num. So remove the check. This removes some port.tty users. Signed-off-by: Jiri Slaby Cc: Alan Cox Cc: Viktar Palstsiuk Cc: Jean-Christophe PLAGNIOL-VILLARD Acked-by: Nicolas Ferre Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 4a0f86fa1e90..6b844d422578 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1256,12 +1256,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, static void atmel_set_ldisc(struct uart_port *port, int new) { - int line = port->line; - - if (line >= port->state->port.tty->driver->num) - return; - - if (port->state->port.tty->ldisc->ops->num == N_PPS) { + if (new == N_PPS) { port->flags |= UPF_HARDPPS_CD; atmel_enable_ms(port); } else {