[patch] Define new section for bus driver init

From: Patrick Mochel (mochel@osdl.org)
Date: Tue Jan 15 2002 - 17:53:15 EST


Ok, here is the consolidated patch. It does:

- defines new section: .devsubsys.init which is a table of function
  pointers to bus driver initialization routines.
- adds section to each architecture's linker scripts
- removes all static calls from init/main.c to bus drivers
- converts drivers with referenced routines to use
  device_subsys_init() to define the init routines, which
  either places init routine in new section or defines it
  as module_init().

Some caveats:

- for a function to be an initcall_t, it must return an int. Some of the
  init routines returned void, and will fail on compile. I punted on
  these, but they need to fixed.

- parisc/kernel/head.S defines the section .initcall.init. Does it also
need to do .devsubsys.init?

- This patch has only been tested on an x86 with PCI and isapnp enabled,
but should work on most everything.

Also, the init routines can now be declared static.

If people could give it a try and let me know if it works for them. And,
if they want to be really nice and convert the driver init routines, I
will integrate the patches and push them upstream.

        -pat

P.s. Pine screws up the patch. It's attached so it applies cleanly (until
I find a better solution).



-
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/



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:54 EST