From 6732c8bb8671acbdac6cdc93dd72ddd581dd5e25 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 3 Jan 2013 15:53:07 +0100 Subject: TTY: switch tty_schedule_flip 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. This is the last one: tty_schedule_flip Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- arch/alpha/kernel/srmcons.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'arch/alpha/kernel') diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 21b57a66e809..6f01d9ad7b81 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -44,9 +44,8 @@ typedef union _srmcons_result { /* called with callback_lock held */ static int -srmcons_do_receive_chars(struct tty_struct *tty) +srmcons_do_receive_chars(struct tty_port *port) { - struct tty_port *port = tty->port; srmcons_result result; int count = 0, loops = 0; @@ -59,7 +58,7 @@ srmcons_do_receive_chars(struct tty_struct *tty) } while((result.bits.status & 1) && (++loops < 10)); if (count) - tty_schedule_flip(tty); + tty_schedule_flip(port); return count; } @@ -74,7 +73,7 @@ srmcons_receive_chars(unsigned long data) local_irq_save(flags); if (spin_trylock(&srmcons_callback_lock)) { - if (!srmcons_do_receive_chars(port->tty)) + if (!srmcons_do_receive_chars(port)) incr = 100; spin_unlock(&srmcons_callback_lock); } @@ -89,7 +88,7 @@ srmcons_receive_chars(unsigned long data) /* called with callback_lock held */ static int -srmcons_do_write(struct tty_struct *tty, const char *buf, int count) +srmcons_do_write(struct tty_port *port, const char *buf, int count) { static char str_cr[1] = "\r"; long c, remaining = count; @@ -114,10 +113,10 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count) cur += result.bits.c; /* - * Check for pending input iff a tty was provided + * Check for pending input iff a tty port was provided */ - if (tty) - srmcons_do_receive_chars(tty); + if (port) + srmcons_do_receive_chars(port); } while (need_cr) { @@ -136,7 +135,7 @@ srmcons_write(struct tty_struct *tty, unsigned long flags; spin_lock_irqsave(&srmcons_callback_lock, flags); - srmcons_do_write(tty, (const char *) buf, count); + srmcons_do_write(tty->port, (const char *) buf, count); spin_unlock_irqrestore(&srmcons_callback_lock, flags); return count; -- cgit v1.2.3