diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 15:53:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 22:22:35 -0800 |
commit | 05c7cd39907184328f48d3e7899f9cdd653ad336 (patch) | |
tree | 9d1ed5c757426aa20b7eccd853faa6b519a4aa7b /drivers/tty/nozomi.c | |
parent | 92a19f9cec9a80ad93c06e115822deb729e2c6ad (diff) | |
download | linux-05c7cd39907184328f48d3e7899f9cdd653ad336.tar.gz linux-05c7cd39907184328f48d3e7899f9cdd653ad336.tar.bz2 linux-05c7cd39907184328f48d3e7899f9cdd653ad336.zip |
TTY: switch tty_insert_flip_string
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
tty_insert_flip_string this time.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r-- | drivers/tty/nozomi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index 437a6366fb7b..941fe8060ea5 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c @@ -827,15 +827,10 @@ static int receive_data(enum port_type index, struct nozomi *dc) struct tty_struct *tty = tty_port_tty_get(&port->port); int i, ret; - if (unlikely(!tty)) { - DBG1("tty not open for port: %d?", index); - return 1; - } - read_mem32((u32 *) &size, addr, 4); /* DBG1( "%d bytes port: %d", size, index); */ - if (test_bit(TTY_THROTTLED, &tty->flags)) { + if (tty && test_bit(TTY_THROTTLED, &tty->flags)) { DBG1("No room in tty, don't read data, don't ack interrupt, " "disable interrupt"); @@ -858,10 +853,11 @@ static int receive_data(enum port_type index, struct nozomi *dc) tty_insert_flip_char(&port->port, buf[0], TTY_NORMAL); size = 0; } else if (size < RECEIVE_BUF_MAX) { - size -= tty_insert_flip_string(tty, (char *) buf, size); + size -= tty_insert_flip_string(&port->port, + (char *)buf, size); } else { - i = tty_insert_flip_string(tty, \ - (char *) buf, RECEIVE_BUF_MAX); + i = tty_insert_flip_string(&port->port, + (char *)buf, RECEIVE_BUF_MAX); size -= i; offset += i; } |