Home > OS >  After the success of the device tree drive through of_device_id matching is how to call the probe fu
After the success of the device tree drive through of_device_id matching is how to call the probe fu

Time:10-28

Nandflash drive, just saw that there were two platform_driver structure of initialization, of course, there are two of_device_id matching, and two of the probe function, as follows:
* * * * * * * * * * *
The static struct platform_driver atmel_nand_nfc_driver={
The driver={
.name="atmel_nand_nfc",
. Of_match_table=of_match_ptr (atmel_nand_nfc_match),
The PM=& amp; Atmel_nand_nfc_pm_ops,
},
The probe=atmel_nand_nfc_probe,
Remove=atmel_nand_nfc_remove,
};
* * * * * * * * * * * * * * * * * *

The static struct platform_driver atmel_nand_driver={
The probe=atmel_nand_probe,
Remove=atmel_nand_remove,
The driver={
.name="atmel_nand",
. Of_match_table=of_match_ptr (atmel_nand_dt_ids),
The PM=& amp; Atmel_nand_pm_ops,
},
};
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The static const struct of_device_id atmel_nand_nfc_match []={
{. Compatible="atmel, sama5d3 - NFC"},
{/* sentinel */}
};
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The static const struct of_device_id atmel_nand_dt_ids []={
{the compatible="atmel at91rm9200 - nand", the data=https://bbs.csdn.net/topics/&at91rm9200_caps},
};
The problem came also, know that the probe function called after a match, but when two of_device_id after the success of the match, they are, respectively, which the probe function called instead? And what platform_driver initialized structure?

CodePudding user response:

This should see dtsi file, which introduces of_device_id, two of_device_id name is different, you can in dtsi grep atmel, sama5d3 - NFC and atmel, at91rm9200 - nand

CodePudding user response:

https://blog.csdn.net/weixin_42462202/article/details/86505992
  • Related