From: Geert U. <ge...@li...> - 2001-06-18 09:07:45
|
On Mon, 18 Jun 2001, Ghozlane Toumi wrote: > I have a small but essential question related to module_init /module_exit > hum. > basicaly "what those functions are doing ?" , nothing less ... > > I guess the module initialisation calls the funciton specified by > module_init, > and same thing at module unload with module_exit, and my question is much > more: > > what happens if those macros are used within a *non* module context ? Then (logical) driver module is still initialized. In the beginning, all builtin drivers of the same class were initialized in one place: | #ifdef CONFIG_DRIVER1 | driver1_init(); | #endif | #ifdef CONFIG_DRIVER2 | driver2_init(); | #endif | #ifdef CONFIG_DRIVER3 | driver3_init(); | #endif Nowadays, the trend is to make drivers more self-contained by using module_{init,exit}(), so the above construct is no longer necessary. Caveat: watch out for the initialization order for modules initialized using module_init(). It depends on the link order now. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |