LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 10:18 AM   #1
david_8274
Member
 
Registered: Jun 2013
Location: California
Distribution: Ubuntu, Fedora
Posts: 75

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, 02:04 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,148

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

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, 02:27 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,148

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
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



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 12:03 AM
Inserting LKM without module_init()...?? manoj7410 Linux - Kernel 5 07-14-2012 03:31 AM
__init() and module_init(). What's the difference? ssg10 Programming 3 05-17-2011 02:59 AM
What is the difference between subsys_initcall() and module_init()? nithima Linux - Newbie 0 05-09-2011 12:12 AM
Multiple Device driver from single device driver???? rickhg12hs Linux - Kernel 3 05-25-2008 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 AM.

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
Open Source Consulting | Domain Registration