aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-08-07 15:47:58 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-13 19:50:21 -0400
commitd2281107457cacf44d60b8a97c5db1af27c3a716 (patch)
treed5192c7d4957ff779381696f44cda62f2940b0df /drivers/s390
parent3ec0a17ef5f4ea922b10ebfdb99473c4d8d6120d (diff)
TTY: con3215, add tty install
This has two outcomes: * we give the TTY layer a tty_port * we do not find the info structure every time open is called on that tty 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 Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/con3215.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 16554982671c..9ffb6d5f17aa 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -942,6 +942,19 @@ static int __init con3215_init(void)
942console_initcall(con3215_init); 942console_initcall(con3215_init);
943#endif 943#endif
944 944
945static int tty3215_install(struct tty_driver *driver, struct tty_struct *tty)
946{
947 struct raw3215_info *raw;
948
949 raw = raw3215[tty->index];
950 if (raw == NULL)
951 return -ENODEV;
952
953 tty->driver_data = raw;
954
955 return tty_port_install(&raw->port, driver, tty);
956}
957
945/* 958/*
946 * tty3215_open 959 * tty3215_open
947 * 960 *
@@ -949,14 +962,9 @@ console_initcall(con3215_init);
949 */ 962 */
950static int tty3215_open(struct tty_struct *tty, struct file * filp) 963static int tty3215_open(struct tty_struct *tty, struct file * filp)
951{ 964{
952 struct raw3215_info *raw; 965 struct raw3215_info *raw = tty->driver_data;
953 int retval; 966 int retval;
954 967
955 raw = raw3215[tty->index];
956 if (raw == NULL)
957 return -ENODEV;
958
959 tty->driver_data = raw;
960 tty_port_tty_set(&raw->port, tty); 968 tty_port_tty_set(&raw->port, tty);
961 969
962 tty->low_latency = 0; /* don't use bottom half for pushing chars */ 970 tty->low_latency = 0; /* don't use bottom half for pushing chars */
@@ -1117,6 +1125,7 @@ static void tty3215_start(struct tty_struct *tty)
1117} 1125}
1118 1126
1119static const struct tty_operations tty3215_ops = { 1127static const struct tty_operations tty3215_ops = {
1128 .install = tty3215_install,
1120 .open = tty3215_open, 1129 .open = tty3215_open,
1121 .close = tty3215_close, 1130 .close = tty3215_close,
1122 .write = tty3215_write, 1131 .write = tty3215_write,