LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2014, 11:18 AM   #1
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 74

Rep: Reputation: Disabled
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
 
Old 04-24-2014, 03:04 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
You don't need module_init if it can't be built as a loadable module.
 
Old 04-24-2014, 03:15 PM   #3
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 74

Original Poster
Rep: Reputation: Disabled
@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
 
Old 04-24-2014, 03:27 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
module_init and probe function call AnkurTank Linux - Kernel 2 04-05-2013 01:03 AM
Inserting LKM without module_init()...?? manoj7410 Linux - Kernel 5 07-14-2012 04:31 AM
__init() and module_init(). What's the difference? ssg10 Programming 3 05-17-2011 03:59 AM
What is the difference between subsys_initcall() and module_init()? nithima Linux - Newbie 0 05-09-2011 01:12 AM
Multiple Device driver from single device driver???? rickhg12hs Linux - Kernel 3 05-25-2008 01:11 AM


All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration