[PATCH][v850] Workaround for tty-driver init-order problem on v850 sim platform

From: Miles Bader
Date: Mon Oct 20 2003 - 02:27:01 EST


Use `late_initcall' instead of just `__initcall' as a workaround for
the fact that (1) simcons_tty_init can't be called before tty_init,
(2) tty_init is called via `module_init', (3) if statically linked,
module_init == device_init, and (4) there's no ordering of init lists.

We can do this easily because simcons is always statically linked, but
other tty drivers that depend on tty_init and which must use
`module_init' to declare their init routines are likely to be broken.

[Please apply -- this problem prevents this platform from booting.]

diff -ruN -X../cludes linux-2.6.0-test8-uc0/arch/v850/kernel/simcons.c linux-2.6.0-test8-uc0-v850-20031020/arch/v850/kernel/simcons.c
--- linux-2.6.0-test8-uc0/arch/v850/kernel/simcons.c 2003-07-14 13:14:39.000000000 +0900
+++ linux-2.6.0-test8-uc0-v850-20031020/arch/v850/kernel/simcons.c 2003-10-20 14:27:53.000000000 +0900
@@ -104,7 +104,14 @@
tty_driver = driver;
return 0;
}
-__initcall (simcons_tty_init);
+/* We use `late_initcall' instead of just `__initcall' as a workaround for
+ the fact that (1) simcons_tty_init can't be called before tty_init,
+ (2) tty_init is called via `module_init', (3) if statically linked,
+ module_init == device_init, and (4) there's no ordering of init lists.
+ We can do this easily because simcons is always statically linked, but
+ other tty drivers that depend on tty_init and which must use
+ `module_init' to declare their init routines are likely to be broken. */
+late_initcall(simcons_tty_init);

/* Poll for input on the console, and if there's any, deliver it to the
tty driver. */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/