diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-07-19 04:54:24 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-20 06:49:18 +0300 |
commit | bb168e2e9e512e6b2cc3ebf6f2ca3fcb07180370 (patch) | |
tree | 8d80579f77385192d9d7607a02046037cedb9ba0 /drivers/net/ethernet/faraday/ftgmac100.c | |
parent | bd466c3fb5a4ff862f805213d7821d8c6f92c382 (diff) | |
download | linux-bb168e2e9e512e6b2cc3ebf6f2ca3fcb07180370.tar.xz |
net/faraday: Match driver according to compatible property
This matches the driver with devices compatible with "faraday,ftgmac100"
declared in the device tree. Originally, device's name from device
tree for it.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday/ftgmac100.c')
-rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 1cd49754c7a3..d8afa2dd8ca7 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1438,14 +1438,20 @@ static int __exit ftgmac100_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id ftgmac100_of_match[] = { + { .compatible = "faraday,ftgmac100" }, + { } +}; +MODULE_DEVICE_TABLE(of, ftgmac100_of_match); + static struct platform_driver ftgmac100_driver = { - .probe = ftgmac100_probe, - .remove = __exit_p(ftgmac100_remove), - .driver = { - .name = DRV_NAME, + .probe = ftgmac100_probe, + .remove = __exit_p(ftgmac100_remove), + .driver = { + .name = DRV_NAME, + .of_match_table = ftgmac100_of_match, }, }; - module_platform_driver(ftgmac100_driver); MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>"); |