

Patch from Russell King <rmk@arm.linux.org.uk>

The following patch (against vanilla 2.5.64) registers the tty devclass
with sysfs before any drivers can use it - sysfs requires structures to
be registered before use.




 drivers/char/tty_io.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -puN drivers/char/tty_io.c~register-tty_devclass drivers/char/tty_io.c
--- 25/drivers/char/tty_io.c~register-tty_devclass	2003-03-08 12:55:50.000000000 -0800
+++ 25-akpm/drivers/char/tty_io.c	2003-03-08 12:55:50.000000000 -0800
@@ -2241,14 +2241,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,

_
