diff options
Diffstat (limited to 'drivers/s390/char/fs3270.c')
-rw-r--r-- | drivers/s390/char/fs3270.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 911704571b9c..230697aac94b 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
@@ -443,7 +443,7 @@ fs3270_open(struct inode *inode, struct file *filp) | |||
443 | tty_kref_put(tty); | 443 | tty_kref_put(tty); |
444 | return -ENODEV; | 444 | return -ENODEV; |
445 | } | 445 | } |
446 | minor = tty->index + RAW3270_FIRSTMINOR; | 446 | minor = tty->index; |
447 | tty_kref_put(tty); | 447 | tty_kref_put(tty); |
448 | } | 448 | } |
449 | mutex_lock(&fs3270_mutex); | 449 | mutex_lock(&fs3270_mutex); |
@@ -524,6 +524,25 @@ static const struct file_operations fs3270_fops = { | |||
524 | .llseek = no_llseek, | 524 | .llseek = no_llseek, |
525 | }; | 525 | }; |
526 | 526 | ||
527 | void fs3270_create_cb(int minor) | ||
528 | { | ||
529 | __register_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub", &fs3270_fops); | ||
530 | device_create(class3270, NULL, MKDEV(IBM_FS3270_MAJOR, minor), | ||
531 | NULL, "3270/tub%d", minor); | ||
532 | } | ||
533 | |||
534 | void fs3270_destroy_cb(int minor) | ||
535 | { | ||
536 | device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, minor)); | ||
537 | __unregister_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub"); | ||
538 | } | ||
539 | |||
540 | struct raw3270_notifier fs3270_notifier = | ||
541 | { | ||
542 | .create = fs3270_create_cb, | ||
543 | .destroy = fs3270_destroy_cb, | ||
544 | }; | ||
545 | |||
527 | /* | 546 | /* |
528 | * 3270 fullscreen driver initialization. | 547 | * 3270 fullscreen driver initialization. |
529 | */ | 548 | */ |
@@ -532,16 +551,20 @@ fs3270_init(void) | |||
532 | { | 551 | { |
533 | int rc; | 552 | int rc; |
534 | 553 | ||
535 | rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops); | 554 | rc = __register_chrdev(IBM_FS3270_MAJOR, 0, 1, "fs3270", &fs3270_fops); |
536 | if (rc) | 555 | if (rc) |
537 | return rc; | 556 | return rc; |
557 | device_create(class3270, NULL, MKDEV(IBM_FS3270_MAJOR, 0), | ||
558 | NULL, "3270/tub"); | ||
559 | raw3270_register_notifier(&fs3270_notifier); | ||
538 | return 0; | 560 | return 0; |
539 | } | 561 | } |
540 | 562 | ||
541 | static void __exit | 563 | static void __exit |
542 | fs3270_exit(void) | 564 | fs3270_exit(void) |
543 | { | 565 | { |
544 | unregister_chrdev(IBM_FS3270_MAJOR, "fs3270"); | 566 | raw3270_unregister_notifier(&fs3270_notifier); |
567 | __unregister_chrdev(IBM_FS3270_MAJOR, 0, 1, "fs3270"); | ||
545 | } | 568 | } |
546 | 569 | ||
547 | MODULE_LICENSE("GPL"); | 570 | MODULE_LICENSE("GPL"); |