When "probe" is called?

Joy Sun joy2sun127 at gmail.com
Mon Feb 7 09:38:25 EST 2011


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 <gnurou at gmail.com> wrote:

> > 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
> > time? Or Is there other mechanism to detect the device? Basically, how
> the
> > 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 


More information about the Kernelnewbies mailing list