Skip to content

Commit

Permalink
net/faraday: Match driver according to compatible property
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gavin Shan authored and David S. Miller committed Jul 20, 2016
1 parent bd466c3 commit bb168e2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>");
Expand Down

0 comments on commit bb168e2

Please sign in to comment.