LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   does a device driver must have module_init() (https://www.linuxquestions.org/questions/linux-newbie-8/does-a-device-driver-must-have-module_init-4175502848/)

david_8274 04-24-2014 10:18 AM

does a device driver must have module_init()
 
Hi,

Does a device driver must have a module_init() system call? I am looking at a working driver and don't see module_init() inside (which seems to be strange to a newbie like me).

Thanks,
Wei

smallpond 04-24-2014 02:04 PM

You don't need module_init if it can't be built as a loadable module.

david_8274 04-24-2014 02:15 PM

@smallpond,


Thanks for the reply. Did you mean that if I compile a driver as part of the kernel (as oppose to as a loadable module), the module_init() is not needed?

Wei Xu

smallpond 04-24-2014 02:27 PM

An init entry point may still be needed for drivers which need initialization at boot time. I was suggesting a reason why the existing driver might not have module_init.


All times are GMT -5. The time now is 08:56 AM.