From: Russell King Date: Sat, 15 Mar 2003 10:37:42 +0000 (+0000) Subject: [TTY] Register tty devclass before use. X-Git-Tag: v2.5.65~30^2 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=c4ab9d7892e7f3bf3698f514c8db8f5e719f2b66;p=history.git [TTY] Register tty devclass before use. 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(). --- diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 32488d71037f..86e3216d0547 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -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,