diff options
Diffstat (limited to 'drivers/s390/char/con3215.c')
-rw-r--r-- | drivers/s390/char/con3215.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 6c0116d48c74..9ffb6d5f17aa 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -716,10 +716,17 @@ static int raw3215_probe (struct ccw_device *cdev) | |||
716 | static void raw3215_remove (struct ccw_device *cdev) | 716 | static void raw3215_remove (struct ccw_device *cdev) |
717 | { | 717 | { |
718 | struct raw3215_info *raw; | 718 | struct raw3215_info *raw; |
719 | unsigned int line; | ||
719 | 720 | ||
720 | ccw_device_set_offline(cdev); | 721 | ccw_device_set_offline(cdev); |
721 | raw = dev_get_drvdata(&cdev->dev); | 722 | raw = dev_get_drvdata(&cdev->dev); |
722 | if (raw) { | 723 | if (raw) { |
724 | spin_lock(&raw3215_device_lock); | ||
725 | for (line = 0; line < NR_3215; line++) | ||
726 | if (raw3215[line] == raw) | ||
727 | break; | ||
728 | raw3215[line] = NULL; | ||
729 | spin_unlock(&raw3215_device_lock); | ||
723 | dev_set_drvdata(&cdev->dev, NULL); | 730 | dev_set_drvdata(&cdev->dev, NULL); |
724 | raw3215_free_info(raw); | 731 | raw3215_free_info(raw); |
725 | } | 732 | } |
@@ -935,6 +942,19 @@ static int __init con3215_init(void) | |||
935 | console_initcall(con3215_init); | 942 | console_initcall(con3215_init); |
936 | #endif | 943 | #endif |
937 | 944 | ||
945 | static 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 | |||
938 | /* | 958 | /* |
939 | * tty3215_open | 959 | * tty3215_open |
940 | * | 960 | * |
@@ -942,14 +962,9 @@ console_initcall(con3215_init); | |||
942 | */ | 962 | */ |
943 | static int tty3215_open(struct tty_struct *tty, struct file * filp) | 963 | static int tty3215_open(struct tty_struct *tty, struct file * filp) |
944 | { | 964 | { |
945 | struct raw3215_info *raw; | 965 | struct raw3215_info *raw = tty->driver_data; |
946 | int retval; | 966 | int retval; |
947 | 967 | ||
948 | raw = raw3215[tty->index]; | ||
949 | if (raw == NULL) | ||
950 | return -ENODEV; | ||
951 | |||
952 | tty->driver_data = raw; | ||
953 | tty_port_tty_set(&raw->port, tty); | 968 | tty_port_tty_set(&raw->port, tty); |
954 | 969 | ||
955 | 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 */ |
@@ -1110,6 +1125,7 @@ static void tty3215_start(struct tty_struct *tty) | |||
1110 | } | 1125 | } |
1111 | 1126 | ||
1112 | static const struct tty_operations tty3215_ops = { | 1127 | static const struct tty_operations tty3215_ops = { |
1128 | .install = tty3215_install, | ||
1113 | .open = tty3215_open, | 1129 | .open = tty3215_open, |
1114 | .close = tty3215_close, | 1130 | .close = tty3215_close, |
1115 | .write = tty3215_write, | 1131 | .write = tty3215_write, |