When does the probe function for a Linux kernel driver gets called?

后端 未结 3 2009
轻奢々
轻奢々 2021-02-13 16:23

I am trying to update a kernel driver for Android, I have added some printk\'s to debug it, the _init function is invoked, but the probe function is not. What I am missing ? Whe

3条回答
  •  春和景丽
    2021-02-13 17:14

    When a module_init is called (insmod in case of dynamic loading) then the driver registration is done, and the various callbacks probe, resume, suspend related to the driver are present.

    Now the main thing to understand this is what all happens in probe function. If you notice then in probe most the initialisation related to device is done (eg. settings associated with DEVICE), so obviously this should execute when device is present.

    Probe is called when the device and driver name/id are matched i.e. verified that these will be coupled/linked. So now we are sure that say Driver ABC will be associated with Device ABC; so do the initialization settings for Device ABC in probe of Driver ABC.

提交回复
热议问题