summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-06-01 22:52:53 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 13:47:41 -0700
commitd87d9b7d19f04b16c4406d3c0feeca10090e0ada (patch)
treec6eadc964d4fdfe9e421a2d4d4143748f4668a6b /drivers/serial
parenteab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 (diff)
downloadlinux-d87d9b7d19f04b16c4406d3c0feeca10090e0ada.tar.gz
linux-d87d9b7d19f04b16c4406d3c0feeca10090e0ada.tar.bz2
linux-d87d9b7d19f04b16c4406d3c0feeca10090e0ada.zip
tty: serial - fix tty referencing in set_ldisc
Pass down the ldisc number so that the drivers don't have to peek into the tty object themselves. This lets us get rid of another case of back referencing port to tty which we don't want (because of races versus hangup/close). Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/bfin_5xx.c7
-rw-r--r--drivers/serial/serial_core.c2
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 511cbf687877..a9eff2b18eab 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -957,15 +957,12 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser)
* Enable the IrDA function if tty->ldisc.num is N_IRDA.
* In other cases, disable IrDA function.
*/
-static void bfin_serial_set_ldisc(struct uart_port *port)
+static void bfin_serial_set_ldisc(struct uart_port *port, int ld)
{
int line = port->line;
unsigned short val;
- if (line >= port->state->port.tty->driver->num)
- return;
-
- switch (port->state->port.tty->termios->c_line) {
+ switch (ld) {
case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC);
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 12ee7e0f99ce..570dca2935e2 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1194,7 +1194,7 @@ static void uart_set_ldisc(struct tty_struct *tty)
struct uart_port *uport = state->uart_port;
if (uport->ops->set_ldisc)
- uport->ops->set_ldisc(uport);
+ uport->ops->set_ldisc(uport, tty->termios->c_line);
}
static void uart_set_termios(struct tty_struct *tty,