刚看了nandflash驱动,发现里面有两个platform_driver结构体的初始化,当然也有两个of_device_id匹配,和两个probe函数,如下:
***********
static struct platform_driver atmel_nand_nfc_driver = {
.driver = {
.name = "atmel_nand_nfc",
.of_match_table = of_match_ptr(atmel_nand_nfc_match),
.pm = &atmel_nand_nfc_pm_ops,
},
.probe = atmel_nand_nfc_probe,
.remove = atmel_nand_nfc_remove,
};
******************static struct platform_driver atmel_nand_driver = {
.probe = atmel_nand_probe,
.remove = atmel_nand_remove,
.driver = {
.name = "atmel_nand",
.of_match_table = of_match_ptr(atmel_nand_dt_ids),
.pm = &atmel_nand_pm_ops,
},
};
---------------------------
static const struct of_device_id atmel_nand_nfc_match[] = {
{ .compatible = "atmel,sama5d3-nfc" },
{ /* sentinel */ }
};
---------------------------
static const struct of_device_id atmel_nand_dt_ids[] = {
{ .compatible = "atmel,at91rm9200-nand", .data = &at91rm9200_caps}, 
};
那么问题也来了,都知道匹配成功后调用probe函数,可是当两个of_device_id匹配成功后,他们都分别改调用哪个probe函数呢?以及用哪个platform_driver初始化的结构体呢?