Thread (7 messages) 7 messages, 4 authors, 2011-02-07

When "probe" is called?

From: Joy Sun <hidden>
Date: 2011-02-07 14:38:25

Thank you so much with the nice example code. Now, I could understand.

Thanks!

J.

On Sun, Feb 6, 2011 at 11:51 PM, Alexandre Courbot [off-list ref] wrote:
quoted
However, could you point me out where the kernel actually detects the
device? Is it keep polling with the driver's name which was given at
compile
quoted
time? Or Is there other mechanism to detect the device? Basically, how
the
quoted
kernel detects those devices, which calls "probe"?
Platform devices represent devices that are usually integrated into a
given chip and therefore are always there. The platform-specific
initialization code statically initializes such arrays of platform
devices and then registers them in a row using platform_register.
Therefore there is no need for sophisticated probing. Instead, the
string contained in platform_device.name is compared
platform_driver.driver.name and a match is assumed if they are equal.
Have a look at the attached example file that defines and registers a
dummy platform driver for a dummy platform device. If you change the
string, the probe function will not be called anymore.

Other buses have more sophisticated detection/probing methods. For
more information about platform devices, including the places where
these functions are called, see drivers/base/platform.c. Reading
Documentation/driver-model/platform.txt is also a good idea.

Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110207/c120d6b4/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help