aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/fs_enet-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fs_enet/fs_enet-main.c')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index d6e3111959ab..21abb5c01a56 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -40,6 +40,7 @@
40#include <linux/of_mdio.h> 40#include <linux/of_mdio.h>
41#include <linux/of_platform.h> 41#include <linux/of_platform.h>
42#include <linux/of_gpio.h> 42#include <linux/of_gpio.h>
43#include <linux/of_net.h>
43 44
44#include <linux/vmalloc.h> 45#include <linux/vmalloc.h>
45#include <asm/pgtable.h> 46#include <asm/pgtable.h>
@@ -955,8 +956,6 @@ static const struct ethtool_ops fs_ethtool_ops = {
955 .get_link = ethtool_op_get_link, 956 .get_link = ethtool_op_get_link,
956 .get_msglevel = fs_get_msglevel, 957 .get_msglevel = fs_get_msglevel,
957 .set_msglevel = fs_set_msglevel, 958 .set_msglevel = fs_set_msglevel,
958 .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
959 .set_sg = ethtool_op_set_sg,
960 .get_regs = fs_get_regs, 959 .get_regs = fs_get_regs,
961}; 960};
962 961
@@ -997,9 +996,10 @@ static const struct net_device_ops fs_enet_netdev_ops = {
997#endif 996#endif
998}; 997};
999 998
1000static int __devinit fs_enet_probe(struct platform_device *ofdev, 999static struct of_device_id fs_enet_match[];
1001 const struct of_device_id *match) 1000static int __devinit fs_enet_probe(struct platform_device *ofdev)
1002{ 1001{
1002 const struct of_device_id *match;
1003 struct net_device *ndev; 1003 struct net_device *ndev;
1004 struct fs_enet_private *fep; 1004 struct fs_enet_private *fep;
1005 struct fs_platform_info *fpi; 1005 struct fs_platform_info *fpi;
@@ -1007,6 +1007,10 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
1007 const u8 *mac_addr; 1007 const u8 *mac_addr;
1008 int privsize, len, ret = -ENODEV; 1008 int privsize, len, ret = -ENODEV;
1009 1009
1010 match = of_match_device(fs_enet_match, &ofdev->dev);
1011 if (!match)
1012 return -EINVAL;
1013
1010 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); 1014 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
1011 if (!fpi) 1015 if (!fpi)
1012 return -ENOMEM; 1016 return -ENOMEM;
@@ -1036,7 +1040,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
1036 ndev = alloc_etherdev(privsize); 1040 ndev = alloc_etherdev(privsize);
1037 if (!ndev) { 1041 if (!ndev) {
1038 ret = -ENOMEM; 1042 ret = -ENOMEM;
1039 goto out_free_fpi; 1043 goto out_put;
1040 } 1044 }
1041 1045
1042 SET_NETDEV_DEV(ndev, &ofdev->dev); 1046 SET_NETDEV_DEV(ndev, &ofdev->dev);
@@ -1099,6 +1103,7 @@ out_cleanup_data:
1099out_free_dev: 1103out_free_dev:
1100 free_netdev(ndev); 1104 free_netdev(ndev);
1101 dev_set_drvdata(&ofdev->dev, NULL); 1105 dev_set_drvdata(&ofdev->dev, NULL);
1106out_put:
1102 of_node_put(fpi->phy_node); 1107 of_node_put(fpi->phy_node);
1103out_free_fpi: 1108out_free_fpi:
1104 kfree(fpi); 1109 kfree(fpi);
@@ -1154,7 +1159,7 @@ static struct of_device_id fs_enet_match[] = {
1154}; 1159};
1155MODULE_DEVICE_TABLE(of, fs_enet_match); 1160MODULE_DEVICE_TABLE(of, fs_enet_match);
1156 1161
1157static struct of_platform_driver fs_enet_driver = { 1162static struct platform_driver fs_enet_driver = {
1158 .driver = { 1163 .driver = {
1159 .owner = THIS_MODULE, 1164 .owner = THIS_MODULE,
1160 .name = "fs_enet", 1165 .name = "fs_enet",
@@ -1166,12 +1171,12 @@ static struct of_platform_driver fs_enet_driver = {
1166 1171
1167static int __init fs_init(void) 1172static int __init fs_init(void)
1168{ 1173{
1169 return of_register_platform_driver(&fs_enet_driver); 1174 return platform_driver_register(&fs_enet_driver);
1170} 1175}
1171 1176
1172static void __exit fs_cleanup(void) 1177static void __exit fs_cleanup(void)
1173{ 1178{
1174 of_unregister_platform_driver(&fs_enet_driver); 1179 platform_driver_unregister(&fs_enet_driver);
1175} 1180}
1176 1181
1177#ifdef CONFIG_NET_POLL_CONTROLLER 1182#ifdef CONFIG_NET_POLL_CONTROLLER