Skip to content

Commit

Permalink
tty/n_gsm: fix bug in tiocmset
Browse files Browse the repository at this point in the history
Clear bitmask was not inverted before masking modem_tx.

Calling ioctl(fd, TIOCMBIC, TIOCM_RTS) results in:

[  197.430000] pre_modem_tx:	0x00000006
[  197.430000] clear:			0x00000004
[  197.430000] set:			0x00000000
[  197.440000] post_modem_tx:	0x00000004

which is wrong.

Signed-off-by: Nikola Diklic-Perin <diklic.perin.nikola@gmail.com>
Acked-by: Alan Cox <alan@linx.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Nikola Diklic-Perin authored and Greg Kroah-Hartman committed Sep 26, 2011
1 parent fd01a7a commit cf16807
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2989,7 +2989,7 @@ static int gsmtty_tiocmset(struct tty_struct *tty,
struct gsm_dlci *dlci = tty->driver_data;
unsigned int modem_tx = dlci->modem_tx;

modem_tx &= clear;
modem_tx &= ~clear;
modem_tx |= set;

if (modem_tx != dlci->modem_tx) {
Expand Down

0 comments on commit cf16807

Please sign in to comment.