net/faraday: Match driver according to compatible property
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Tue, 19 Jul 2016 01:54:24 +0000 (11:54 +1000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Jul 2016 03:49:18 +0000 (20:49 -0700)
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>
drivers/net/ethernet/faraday/ftgmac100.c

index 1cd49754c7a343295c2c2abb258f937b905d464d..d8afa2dd8ca71f1024f4e80322ecb7e5148fe574 100644 (file)
@@ -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>");