From 8ec459a348f11107969748fbb93e430958117011 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 21 Oct 2003 18:23:51 -0700 Subject: [PATCH] [PATCH] v850: Workaround for tty-driver init-order problem From: miles@lsi.nec.co.jp (Miles Bader) 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. --- arch/v850/kernel/simcons.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c index c4996c89eeddd..9aed8871b8c5a 100644 --- a/arch/v850/kernel/simcons.c +++ b/arch/v850/kernel/simcons.c @@ -104,7 +104,14 @@ int __init simcons_tty_init (void) 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. */ -- 2.53.0