[PATCH] Register tty_devclass before use

Russell King (rmk@arm.linux.org.uk)
Sat, 8 Mar 2003 12:11:03 +0000


Hi,

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.

The patch applies to bk-curr with offset.

--- orig/drivers/char/tty_io.c Wed Mar 5 19:45:15 2003
+++ linux/drivers/char/tty_io.c Sat Mar 8 12:01:41 2003
@@ -2307,14 +2307,19 @@
};
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,

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/