[lkml]   [2006]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectThe invoking of probe function for platform devices ??

Hello Greg,

I just started to hack the Linux kernel source code and I am having a doubt
regarding the platform devices addition in Linux kernel.

My understanding is now the platform device also uses probe functions.
Usually for plug and play devices like USB, when it is plugged some signals
from the USB device and HOST does the trick of invoking the probe functions.

For platform devices like RTC which is not plug_and_play, how this probe
function is initiated?

At what stage of the initiation the probe function is called. I guess when
compiled as a module, the only entry point of the driver I will be having is
init function and the exit point is exit function. Then how will it be
entering into the probe function for platform devices?

If my understanding about the probe function is incorrect please clarify my

Please find the code snippet for the platform_driver I tried below.

Struct platform_device *my_dev;

Struct my_res = {
.start = start_of_my_device_res, //Starting of the physical address
of //the device I am playing
.end = end_of_my_device_res,
.name = "my_res",


Struct platform_driver my_drv ={
.probe = my_probe,
.remove = my_remove,
.driver = {
.name = "my_platform_driver",
.owner = THIS_MODULE,

static int __init ds15x1rtc_init(void)
int err;

if ((err = platform_driver_register(&my_drv)))
return err;

if ((my_dev = platform_device_register_simple("my_platform_device",
1, &my_res,1)) == NULL){
printk("device registeration failed\n");
goto errout_pf_dev_register;

return 0;

return err;


static void __exit ds15x1rtc_cleanup(void)


Also is it a right thing to do the initialization of the resource of my
platform device in this file or should it be done in the target specific
initialization codes for more portability?

Thanks in advance

Anil Jacob

"This e-mail and any files transmitted with it are for the sole use
of the intended recipient(s) and may contain confidential and privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

Any unauthorized review, use, disclosure, dissemination, forwarding,
printing or copying of this email or any action taken upon this e-mail is
strictly prohibited and may be unlawful."
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-12-07 09:07    [W:0.025 / U:40.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site