Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92a19f9c authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

TTY: switch tty_insert_flip_char



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_char is the next one to proceed. This one is used all
over the code, so the patch is huge.

Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f693357
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -46,13 +46,14 @@ typedef union _srmcons_result {
static int
srmcons_do_receive_chars(struct tty_struct *tty)
{
	struct tty_port *port = tty->port;
	srmcons_result result;
	int count = 0, loops = 0;

	do {
		result.as_long = callback_getc(0);
		if (result.bits.status < 2) {
			tty_insert_flip_char(tty, (char)result.bits.c, 0);
			tty_insert_flip_char(port, (char)result.bits.c, 0);
			count++;
		}
	} while((result.bits.status & 1) && (++loops < 10));
+2 −1
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ static struct console *console;

static void receive_chars(struct tty_struct *tty)
{
	struct tty_port *port = tty->port;
	unsigned char ch;
	static unsigned char seen_esc = 0;

@@ -81,7 +82,7 @@ static void receive_chars(struct tty_struct *tty)
		}
		seen_esc = 0;

		if (tty_insert_flip_char(tty, ch, TTY_NORMAL) == 0)
		if (tty_insert_flip_char(port, ch, TTY_NORMAL) == 0)
			break;
	}
	tty_flip_buffer_push(tty);
+2 −2
Original line number Diff line number Diff line
@@ -667,14 +667,14 @@ static void mn10300_serial_receive_interrupt(struct mn10300_serial_port *port)
		else
			flag = TTY_NORMAL;

		tty_insert_flip_char(tty, ch, flag);
		tty_insert_flip_char(port, ch, flag);
	}

	/* overrun is special, since it's reported immediately, and doesn't
	 * affect the current character
	 */
	if (overrun)
		tty_insert_flip_char(tty, 0, TTY_OVERRUN);
		tty_insert_flip_char(port, 0, TTY_OVERRUN);

	count--;
	if (count <= 0) {
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ static void pdc_console_poll(unsigned long unused)
		data = pdc_console_poll_key(NULL);
		if (data == -1)
			break;
		tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
		tty_insert_flip_char(&tty_port, data & 0xFF, TTY_NORMAL);
		count ++;
	}

+1 −7
Original line number Diff line number Diff line
@@ -81,12 +81,6 @@ static const struct chan_ops not_configged_ops = {
};
#endif /* CONFIG_NOCONFIG_CHAN */

static void tty_receive_char(struct tty_struct *tty, char ch)
{
	if (tty)
		tty_insert_flip_char(tty, ch, TTY_NORMAL);
}

static int open_one_chan(struct chan *chan)
{
	int fd, err;
@@ -569,7 +563,7 @@ void chan_interrupt(struct line *line, struct tty_struct *tty, int irq)
		}
		err = chan->ops->read(chan->fd, &c, chan->data);
		if (err > 0)
			tty_receive_char(tty, c);
			tty_insert_flip_char(port, c, TTY_NORMAL);
	} while (err > 0);

	if (err == 0)
Loading