public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* initcall ordering of driver w/respect to tty_init?
@ 2003-10-08  7:48 Miles Bader
  2003-10-10 15:02 ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Bader @ 2003-10-08  7:48 UTC (permalink / raw)
  To: linux-kernel

I have a tty driver, arch/v850/kernel/simcons.c, who's init function is
called via __initcall:

   int __init simcons_tty_init (void)
   {
           struct tty_driver *driver = alloc_tty_driver(1);
   ...
           err = tty_register_driver(driver);
   }
   __initcall (simcons_tty_init);

I'm getting errors because this init function is being called _before_
tty_init, and tty_kobj (which is the `parent' kobj of simcon's kobj) is
apparently not setup correctly yet when the simcons_tty_init calls
tty_register_driver.

Since there seems to be no way of ordering basic initcalls, I can see
why it's happening.  But what's the proper way to avoid this?  Other
tty drivers that call tty_register_driver also seem to get initialized
via initcalls (usually declared with module_init), so maybe this
problem exists for other drivers too.

Thanks,

-Miles
-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-14  2:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-08  7:48 initcall ordering of driver w/respect to tty_init? Miles Bader
2003-10-10 15:02 ` Randy.Dunlap
2003-10-10 18:12   ` Miles Bader
2003-10-14  2:12     ` Miles Bader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox