aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/irtty-sir.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-14 10:31:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 16:00:41 -0400
commitadc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch)
treee3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /drivers/net/irda/irtty-sir.c
parent6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (diff)
tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The alternative would be to keep points and refcount the termios objects. However 1. They are tiny anyway 2. Many devices don't use the stored copies 3. We can remove a pty special case Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/irda/irtty-sir.c')
-rw-r--r--drivers/net/irda/irtty-sir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 3352b2443e58..30087ca23a0f 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -124,8 +124,8 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed)
124 tty = priv->tty; 124 tty = priv->tty;
125 125
126 mutex_lock(&tty->termios_mutex); 126 mutex_lock(&tty->termios_mutex);
127 old_termios = *(tty->termios); 127 old_termios = tty->termios;
128 cflag = tty->termios->c_cflag; 128 cflag = tty->termios.c_cflag;
129 tty_encode_baud_rate(tty, speed, speed); 129 tty_encode_baud_rate(tty, speed, speed);
130 if (tty->ops->set_termios) 130 if (tty->ops->set_termios)
131 tty->ops->set_termios(tty, &old_termios); 131 tty->ops->set_termios(tty, &old_termios);
@@ -281,15 +281,15 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop)
281 int cflag; 281 int cflag;
282 282
283 mutex_lock(&tty->termios_mutex); 283 mutex_lock(&tty->termios_mutex);
284 old_termios = *(tty->termios); 284 old_termios = tty->termios;
285 cflag = tty->termios->c_cflag; 285 cflag = tty->termios.c_cflag;
286 286
287 if (stop) 287 if (stop)
288 cflag &= ~CREAD; 288 cflag &= ~CREAD;
289 else 289 else
290 cflag |= CREAD; 290 cflag |= CREAD;
291 291
292 tty->termios->c_cflag = cflag; 292 tty->termios.c_cflag = cflag;
293 if (tty->ops->set_termios) 293 if (tty->ops->set_termios)
294 tty->ops->set_termios(tty, &old_termios); 294 tty->ops->set_termios(tty, &old_termios);
295 mutex_unlock(&tty->termios_mutex); 295 mutex_unlock(&tty->termios_mutex);