]> git.neil.brown.name Git - history.git/commitdiff
[TTY] Register tty devclass before use.
authorRussell King <rmk@flint.arm.linux.org.uk>
Sat, 15 Mar 2003 10:37:42 +0000 (10:37 +0000)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 15 Mar 2003 10:37:42 +0000 (10:37 +0000)
Register the tty devclass with sysfs before tty drivers initialise -
sysfs requires structures to be registered before use.  This is
required for the previous serial csets, as well as any drivers which
are initialising using __initcall() or module_init().

drivers/char/tty_io.c

index 32488d71037fdd86aa896ecc677bf10478d81c15..86e3216d05475b481db0b750fddd0e5d75cdf7ea 100644 (file)
@@ -2235,14 +2235,19 @@ struct device_class tty_devclass = {
 };
 EXPORT_SYMBOL(tty_devclass);
 
+static int __init tty_devclass_init(void)
+{
+       return devclass_register(&tty_devclass);
+}
+
+postcore_initcall(tty_devclass_init);
+
 /*
  * Ok, now we can initialize the rest of the tty devices and can count
  * on memory allocations, interrupts etc..
  */
 void __init tty_init(void)
 {
-       devclass_register(&tty_devclass);
-
        /*
         * dev_tty_driver and dev_console_driver are actually magic
         * devices which get redirected at open time.  Nevertheless,