diff options
Diffstat (limited to 'drivers/s390/char/tty3270.c')
| -rw-r--r-- | drivers/s390/char/tty3270.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index b907dba24025..cee69dac3e18 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
| @@ -915,7 +915,7 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty) | |||
| 915 | int i, rc; | 915 | int i, rc; |
| 916 | 916 | ||
| 917 | /* Check if the tty3270 is already there. */ | 917 | /* Check if the tty3270 is already there. */ |
| 918 | view = raw3270_find_view(&tty3270_fn, tty->index); | 918 | view = raw3270_find_view(&tty3270_fn, tty->index + RAW3270_FIRSTMINOR); |
| 919 | if (!IS_ERR(view)) { | 919 | if (!IS_ERR(view)) { |
| 920 | tp = container_of(view, struct tty3270, view); | 920 | tp = container_of(view, struct tty3270, view); |
| 921 | tty->driver_data = tp; | 921 | tty->driver_data = tp; |
| @@ -927,15 +927,16 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty) | |||
| 927 | tp->inattr = TF_INPUT; | 927 | tp->inattr = TF_INPUT; |
| 928 | return tty_port_install(&tp->port, driver, tty); | 928 | return tty_port_install(&tp->port, driver, tty); |
| 929 | } | 929 | } |
| 930 | if (tty3270_max_index < tty->index) | 930 | if (tty3270_max_index < tty->index + 1) |
| 931 | tty3270_max_index = tty->index; | 931 | tty3270_max_index = tty->index + 1; |
| 932 | 932 | ||
| 933 | /* Allocate tty3270 structure on first open. */ | 933 | /* Allocate tty3270 structure on first open. */ |
| 934 | tp = tty3270_alloc_view(); | 934 | tp = tty3270_alloc_view(); |
| 935 | if (IS_ERR(tp)) | 935 | if (IS_ERR(tp)) |
| 936 | return PTR_ERR(tp); | 936 | return PTR_ERR(tp); |
| 937 | 937 | ||
| 938 | rc = raw3270_add_view(&tp->view, &tty3270_fn, tty->index); | 938 | rc = raw3270_add_view(&tp->view, &tty3270_fn, |
| 939 | tty->index + RAW3270_FIRSTMINOR); | ||
| 939 | if (rc) { | 940 | if (rc) { |
| 940 | tty3270_free_view(tp); | 941 | tty3270_free_view(tp); |
| 941 | return rc; | 942 | return rc; |
| @@ -1846,12 +1847,12 @@ static const struct tty_operations tty3270_ops = { | |||
| 1846 | 1847 | ||
| 1847 | void tty3270_create_cb(int minor) | 1848 | void tty3270_create_cb(int minor) |
| 1848 | { | 1849 | { |
| 1849 | tty_register_device(tty3270_driver, minor, NULL); | 1850 | tty_register_device(tty3270_driver, minor - RAW3270_FIRSTMINOR, NULL); |
| 1850 | } | 1851 | } |
| 1851 | 1852 | ||
| 1852 | void tty3270_destroy_cb(int minor) | 1853 | void tty3270_destroy_cb(int minor) |
| 1853 | { | 1854 | { |
| 1854 | tty_unregister_device(tty3270_driver, minor); | 1855 | tty_unregister_device(tty3270_driver, minor - RAW3270_FIRSTMINOR); |
| 1855 | } | 1856 | } |
| 1856 | 1857 | ||
| 1857 | struct raw3270_notifier tty3270_notifier = | 1858 | struct raw3270_notifier tty3270_notifier = |
| @@ -1884,7 +1885,8 @@ static int __init tty3270_init(void) | |||
| 1884 | driver->driver_name = "tty3270"; | 1885 | driver->driver_name = "tty3270"; |
| 1885 | driver->name = "3270/tty"; | 1886 | driver->name = "3270/tty"; |
| 1886 | driver->major = IBM_TTY3270_MAJOR; | 1887 | driver->major = IBM_TTY3270_MAJOR; |
| 1887 | driver->minor_start = 0; | 1888 | driver->minor_start = RAW3270_FIRSTMINOR; |
| 1889 | driver->name_base = RAW3270_FIRSTMINOR; | ||
| 1888 | driver->type = TTY_DRIVER_TYPE_SYSTEM; | 1890 | driver->type = TTY_DRIVER_TYPE_SYSTEM; |
| 1889 | driver->subtype = SYSTEM_TYPE_TTY; | 1891 | driver->subtype = SYSTEM_TYPE_TTY; |
| 1890 | driver->init_termios = tty_std_termios; | 1892 | driver->init_termios = tty_std_termios; |
