[Mod] 增加设备信息,关联of_node
This commit is contained in:
17
spi/pn5180.c
17
spi/pn5180.c
@ -47,14 +47,29 @@ int CHIP_remove(struct spi_device *spi)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF
|
||||||
|
static const struct of_device_id CHIP_of_match[] = {
|
||||||
|
{ .compatible = "nxp,pn5180", },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_DEVICE_TABLE(of, CHIP_of_match);
|
||||||
|
#endif // CONFIG_OF
|
||||||
|
|
||||||
static struct spi_driver CHIP_driver = {
|
static struct spi_driver CHIP_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "CHIP",
|
.name = "CHIP",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
#ifdef CONFIG_OF
|
||||||
|
.of_match_table = CHIP_of_match,
|
||||||
|
#endif // CONFIG_OF
|
||||||
},
|
},
|
||||||
|
|
||||||
.probe = CHIP_probe,
|
.probe = CHIP_probe,
|
||||||
.remove = CHIP_remove,
|
.remove = CHIP_remove,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_spi_driver(CHIP_driver);
|
module_spi_driver(CHIP_driver);
|
||||||
|
|
||||||
|
MODULE_AUTHOR("Gao yang <gaoyang3513@163.com>");
|
||||||
|
MODULE_DESCRIPTION("NXP PN5180 NFC driver");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
|||||||
Reference in New Issue
Block a user