diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:54:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 14:28:17 -0400 |
commit | ba186e7d17ea874f2a56385806e0ef213f58a1dd (patch) | |
tree | 02d5ab7bd13f43fbe12c6d7c7c8452e8788665a5 /drivers/s390/char/keyboard.h | |
parent | 20acdfa85c1c0292ee710335900dc04aa7b634a3 (diff) |
TTY: tty3270, add tty_port
And use tty from that. This means, we convert most of the users to
accept tty_port instead. This is not racy and ensures the tty to be
properly refcounted.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/s390/char/keyboard.h')
-rw-r--r-- | drivers/s390/char/keyboard.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/s390/char/keyboard.h b/drivers/s390/char/keyboard.h index 7e736aaeae6e..f682f4e49680 100644 --- a/drivers/s390/char/keyboard.h +++ b/drivers/s390/char/keyboard.h | |||
@@ -21,7 +21,7 @@ typedef void (fn_handler_fn)(struct kbd_data *); | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | struct kbd_data { | 23 | struct kbd_data { |
24 | struct tty_struct *tty; | 24 | struct tty_port *port; |
25 | unsigned short **key_maps; | 25 | unsigned short **key_maps; |
26 | char **func_table; | 26 | char **func_table; |
27 | fn_handler_fn **fn_handler; | 27 | fn_handler_fn **fn_handler; |
@@ -42,16 +42,24 @@ int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long); | |||
42 | * Helper Functions. | 42 | * Helper Functions. |
43 | */ | 43 | */ |
44 | static inline void | 44 | static inline void |
45 | kbd_put_queue(struct tty_struct *tty, int ch) | 45 | kbd_put_queue(struct tty_port *port, int ch) |
46 | { | 46 | { |
47 | struct tty_struct *tty = tty_port_tty_get(port); | ||
48 | if (!tty) | ||
49 | return; | ||
47 | tty_insert_flip_char(tty, ch, 0); | 50 | tty_insert_flip_char(tty, ch, 0); |
48 | tty_schedule_flip(tty); | 51 | tty_schedule_flip(tty); |
52 | tty_kref_put(tty); | ||
49 | } | 53 | } |
50 | 54 | ||
51 | static inline void | 55 | static inline void |
52 | kbd_puts_queue(struct tty_struct *tty, char *cp) | 56 | kbd_puts_queue(struct tty_port *port, char *cp) |
53 | { | 57 | { |
58 | struct tty_struct *tty = tty_port_tty_get(port); | ||
59 | if (!tty) | ||
60 | return; | ||
54 | while (*cp) | 61 | while (*cp) |
55 | tty_insert_flip_char(tty, *cp++, 0); | 62 | tty_insert_flip_char(tty, *cp++, 0); |
56 | tty_schedule_flip(tty); | 63 | tty_schedule_flip(tty); |
64 | tty_kref_put(tty); | ||
57 | } | 65 | } |