[S390] 3270: do not register with tty_register_device
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 12 Jun 2009 08:26:30 +0000 (10:26 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 12 Jun 2009 08:27:32 +0000 (10:27 +0200)
The tty3270_notifier that calls tty_register_device / tty_unregister_device
is harmful in two ways:
1) the device node that is create is wrong because the minor numbers for
   3270 tty start with 1 and tty_notifier passes the minor as index.
2) If 1) is corrected you'll get a warning:
     WARNING: at fs/sysfs/dir.c:462 sysfs_add_one+0x4c/0x60()
     sysfs: duplicate filename '227:1' can not be created
   The 227:1 link is already created by raw3270_create_attributes to refer
   to ../../class/tty/tty<devno>. There cannot be two links.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/tty3270.c

index a7fe6302c9820c3790f3c14bffb4f0aee4b35679..aa7a114f652958a4f00d8a854e518955460e3c98 100644 (file)
@@ -1754,14 +1754,6 @@ static const struct tty_operations tty3270_ops = {
        .set_termios = tty3270_set_termios
 };
 
-static void tty3270_notifier(int index, int active)
-{
-       if (active)
-               tty_register_device(tty3270_driver, index, NULL);
-       else
-               tty_unregister_device(tty3270_driver, index);
-}
-
 /*
  * 3270 tty registration code called from tty_init().
  * Most kernel services (incl. kmalloc) are available at this poimt.
@@ -1796,12 +1788,6 @@ static int __init tty3270_init(void)
                return ret;
        }
        tty3270_driver = driver;
-       ret = raw3270_register_notifier(tty3270_notifier);
-       if (ret) {
-               put_tty_driver(driver);
-               return ret;
-
-       }
        return 0;
 }
 
@@ -1810,7 +1796,6 @@ tty3270_exit(void)
 {
        struct tty_driver *driver;
 
-       raw3270_unregister_notifier(tty3270_notifier);
        driver = tty3270_driver;
        tty3270_driver = NULL;
        tty_unregister_driver(driver);