aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby2013-01-03 08:53:07 -0600
committerGreg Kroah-Hartman2013-01-16 00:43:15 -0600
commit6732c8bb8671acbdac6cdc93dd72ddd581dd5e25 (patch)
tree6c70977ee03cddd4211b8f775c331b41532ed5da /arch/alpha
parent2e124b4a390ca85325fae75764bef92f0547fa25 (diff)
downloadam43-linux-kernel-6732c8bb8671acbdac6cdc93dd72ddd581dd5e25.tar.gz
am43-linux-kernel-6732c8bb8671acbdac6cdc93dd72ddd581dd5e25.tar.xz
am43-linux-kernel-6732c8bb8671acbdac6cdc93dd72ddd581dd5e25.zip
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 <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/kernel/srmcons.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 21b57a66e80..6f01d9ad7b8 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -44,9 +44,8 @@ typedef union _srmcons_result {
44 44
45/* called with callback_lock held */ 45/* called with callback_lock held */
46static int 46static int
47srmcons_do_receive_chars(struct tty_struct *tty) 47srmcons_do_receive_chars(struct tty_port *port)
48{ 48{
49 struct tty_port *port = tty->port;
50 srmcons_result result; 49 srmcons_result result;
51 int count = 0, loops = 0; 50 int count = 0, loops = 0;
52 51
@@ -59,7 +58,7 @@ srmcons_do_receive_chars(struct tty_struct *tty)
59 } while((result.bits.status & 1) && (++loops < 10)); 58 } while((result.bits.status & 1) && (++loops < 10));
60 59
61 if (count) 60 if (count)
62 tty_schedule_flip(tty); 61 tty_schedule_flip(port);
63 62
64 return count; 63 return count;
65} 64}
@@ -74,7 +73,7 @@ srmcons_receive_chars(unsigned long data)
74 73
75 local_irq_save(flags); 74 local_irq_save(flags);
76 if (spin_trylock(&srmcons_callback_lock)) { 75 if (spin_trylock(&srmcons_callback_lock)) {
77 if (!srmcons_do_receive_chars(port->tty)) 76 if (!srmcons_do_receive_chars(port))
78 incr = 100; 77 incr = 100;
79 spin_unlock(&srmcons_callback_lock); 78 spin_unlock(&srmcons_callback_lock);
80 } 79 }
@@ -89,7 +88,7 @@ srmcons_receive_chars(unsigned long data)
89 88
90/* called with callback_lock held */ 89/* called with callback_lock held */
91static int 90static int
92srmcons_do_write(struct tty_struct *tty, const char *buf, int count) 91srmcons_do_write(struct tty_port *port, const char *buf, int count)
93{ 92{
94 static char str_cr[1] = "\r"; 93 static char str_cr[1] = "\r";
95 long c, remaining = count; 94 long c, remaining = count;
@@ -114,10 +113,10 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
114 cur += result.bits.c; 113 cur += result.bits.c;
115 114
116 /* 115 /*
117 * Check for pending input iff a tty was provided 116 * Check for pending input iff a tty port was provided
118 */ 117 */
119 if (tty) 118 if (port)
120 srmcons_do_receive_chars(tty); 119 srmcons_do_receive_chars(port);
121 } 120 }
122 121
123 while (need_cr) { 122 while (need_cr) {
@@ -136,7 +135,7 @@ srmcons_write(struct tty_struct *tty,
136 unsigned long flags; 135 unsigned long flags;
137 136
138 spin_lock_irqsave(&srmcons_callback_lock, flags); 137 spin_lock_irqsave(&srmcons_callback_lock, flags);
139 srmcons_do_write(tty, (const char *) buf, count); 138 srmcons_do_write(tty->port, (const char *) buf, count);
140 spin_unlock_irqrestore(&srmcons_callback_lock, flags); 139 spin_unlock_irqrestore(&srmcons_callback_lock, flags);
141 140
142 return count; 141 return count;