From: p.ittershagen@googlemail.com (Philipp Ittershagen)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How does the driver initialize corresponding with several same devices ?
Date: Wed, 18 Apr 2012 12:48:48 +0200 [thread overview]
Message-ID: <20120418104847.GA23658@peter> (raw)
In-Reply-To: <CAFNq8R5ni3ugQeVD4YNFzQ3gNRX2tj3JM9sm4v-+bOyA0rJb3g@mail.gmail.com>
On Wed, Apr 18, 2012 at 05:16:01PM +0800, Li Haifeng wrote:
> I make a driver module and built in the kernel.?There are three devices use
> the same driver on the hardware platform.?To use each device, the probe
> function of the driver module should be probed. So, the driver module is
> registered in the kernel.
>
> My question is, how times should the probe function of the driver be called
> and create nodes in devfs to corresponding with the three devices?
It depends on what your architecture supports. If you have support for device
tree, your entry in the device tree will make the subsystem call your probe
function for each device it finds. You can then check the `compatible` entry
of the device node and your driver is then able to register itself to the
kernel subsystem.
Greetings,
Philipp
next prev parent reply other threads:[~2012-04-18 10:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAFNq8R4U-1c4ONn8EDZ7-ZgO2BC0r1JvsBxKsD1MeBzRndJr-w@mail.gmail.com>
[not found] ` <CAFNq8R4dF+QPvPcy5+SSOBketAdzyJfJ6WonX0Z8OHztcvsYvA@mail.gmail.com>
2012-04-18 9:16 ` How does the driver initialize corresponding with several same devices ? Li Haifeng
2012-04-18 10:48 ` Philipp Ittershagen [this message]
[not found] ` <CAK7N6vpEL21SUMWk05ODDY+JE4gMDz7A17zfZDnsfU-=Nw6hiA@mail.gmail.com>
2012-04-18 11:07 ` Philipp Ittershagen
2012-04-18 11:11 ` anish singh
2012-04-18 13:38 ` Li Haifeng
2012-04-18 10:59 ` Javier Martinez Canillas
2012-04-18 11:01 ` Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120418104847.GA23658@peter \
--to=p.ittershagen@googlemail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).