When "probe" is called?

anish singh anish198519851985 at gmail.com
Mon Feb 7 02:29:44 EST 2011


>
> Hi,
>
> I am seeing probe function pointer and know the procedure to register of it
> for a specific device driver. However, I wonder when it is actually called?
>
> For example, for platform drivers, there is a structure like this:
>
> struct platform_driver {
>  int (*probe)(struct platform_device *);
>  int (*remove)(struct platform_device *);
>  void (*shutdown)(struct platform_device *);
>  int (*suspend)(struct platform_device *, pm_message_t state);
>  int (*suspend_late)(struct platform_device *, pm_message_t state);
>  int (*resume_early)(struct platform_device *);
>  int (*resume)(struct platform_device *);
>  struct device_driver driver;
> };
>
>
> Then, it is registered by
>
> int platform_driver_register(struct platform_driver *drv);
>
> But, I wonder when actually, those functions (especially, probe) are
> called. Could you guide me about it, please?

AFAIK probe is called when your device is recognized by the
platform.Generally registering the device requires the device name and this
device name is compared with the driver name(when you are registering the
driver you would be specifying the driver name,which should match with the
device name).
Once the device gets detected by the kernel it will call the corresponding
driver probe for that device.

>
> Thanks,
>
> -J.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110207/dcd56b2f/attachment.html 


More information about the Kernelnewbies mailing list