aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fs_enet')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c21
-rw-r--r--drivers/net/fs_enet/mac-fcc.c2
-rw-r--r--drivers/net/fs_enet/mac-fec.c8
-rw-r--r--drivers/net/fs_enet/mii-bitbang.c9
-rw-r--r--drivers/net/fs_enet/mii-fec.c18
5 files changed, 34 insertions, 24 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
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 7a84e45487e8..7583a9572bcc 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -105,7 +105,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
105 goto out_ep; 105 goto out_ep;
106 106
107 fep->fcc.mem = (void __iomem *)cpm2_immr; 107 fep->fcc.mem = (void __iomem *)cpm2_immr;
108 fpi->dpram_offset = cpm_dpalloc(128, 8); 108 fpi->dpram_offset = cpm_dpalloc(128, 32);
109 if (IS_ERR_VALUE(fpi->dpram_offset)) { 109 if (IS_ERR_VALUE(fpi->dpram_offset)) {
110 ret = fpi->dpram_offset; 110 ret = fpi->dpram_offset;
111 goto out_fcccp; 111 goto out_fcccp;
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 61035fc5599b..b9fbc83d64a7 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -226,8 +226,8 @@ static void set_multicast_finish(struct net_device *dev)
226 } 226 }
227 227
228 FC(fecp, r_cntrl, FEC_RCNTRL_PROM); 228 FC(fecp, r_cntrl, FEC_RCNTRL_PROM);
229 FW(fecp, hash_table_high, fep->fec.hthi); 229 FW(fecp, grp_hash_table_high, fep->fec.hthi);
230 FW(fecp, hash_table_low, fep->fec.htlo); 230 FW(fecp, grp_hash_table_low, fep->fec.htlo);
231} 231}
232 232
233static void set_multicast_list(struct net_device *dev) 233static void set_multicast_list(struct net_device *dev)
@@ -273,8 +273,8 @@ static void restart(struct net_device *dev)
273 /* 273 /*
274 * Reset all multicast. 274 * Reset all multicast.
275 */ 275 */
276 FW(fecp, hash_table_high, fep->fec.hthi); 276 FW(fecp, grp_hash_table_high, fep->fec.hthi);
277 FW(fecp, hash_table_low, fep->fec.htlo); 277 FW(fecp, grp_hash_table_low, fep->fec.htlo);
278 278
279 /* 279 /*
280 * Set maximum receive buffer size. 280 * Set maximum receive buffer size.
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index 3cda2b515471..ad2975440719 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -150,8 +150,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
150 return 0; 150 return 0;
151} 151}
152 152
153static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, 153static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
154 const struct of_device_id *match)
155{ 154{
156 struct mii_bus *new_bus; 155 struct mii_bus *new_bus;
157 struct bb_info *bitbang; 156 struct bb_info *bitbang;
@@ -223,7 +222,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
223}; 222};
224MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match); 223MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
225 224
226static struct of_platform_driver fs_enet_bb_mdio_driver = { 225static struct platform_driver fs_enet_bb_mdio_driver = {
227 .driver = { 226 .driver = {
228 .name = "fsl-bb-mdio", 227 .name = "fsl-bb-mdio",
229 .owner = THIS_MODULE, 228 .owner = THIS_MODULE,
@@ -235,12 +234,12 @@ static struct of_platform_driver fs_enet_bb_mdio_driver = {
235 234
236static int fs_enet_mdio_bb_init(void) 235static int fs_enet_mdio_bb_init(void)
237{ 236{
238 return of_register_platform_driver(&fs_enet_bb_mdio_driver); 237 return platform_driver_register(&fs_enet_bb_mdio_driver);
239} 238}
240 239
241static void fs_enet_mdio_bb_exit(void) 240static void fs_enet_mdio_bb_exit(void)
242{ 241{
243 of_unregister_platform_driver(&fs_enet_bb_mdio_driver); 242 platform_driver_unregister(&fs_enet_bb_mdio_driver);
244} 243}
245 244
246module_init(fs_enet_mdio_bb_init); 245module_init(fs_enet_mdio_bb_init);
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index dbb9c48623df..6a2e150e75bb 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -101,15 +101,21 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
101 return 0; 101 return 0;
102} 102}
103 103
104static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev, 104static struct of_device_id fs_enet_mdio_fec_match[];
105 const struct of_device_id *match) 105static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
106{ 106{
107 const struct of_device_id *match;
107 struct resource res; 108 struct resource res;
108 struct mii_bus *new_bus; 109 struct mii_bus *new_bus;
109 struct fec_info *fec; 110 struct fec_info *fec;
110 int (*get_bus_freq)(struct device_node *) = match->data; 111 int (*get_bus_freq)(struct device_node *);
111 int ret = -ENOMEM, clock, speed; 112 int ret = -ENOMEM, clock, speed;
112 113
114 match = of_match_device(fs_enet_mdio_fec_match, &ofdev->dev);
115 if (!match)
116 return -EINVAL;
117 get_bus_freq = match->data;
118
113 new_bus = mdiobus_alloc(); 119 new_bus = mdiobus_alloc();
114 if (!new_bus) 120 if (!new_bus)
115 goto out; 121 goto out;
@@ -221,7 +227,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
221}; 227};
222MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match); 228MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
223 229
224static struct of_platform_driver fs_enet_fec_mdio_driver = { 230static struct platform_driver fs_enet_fec_mdio_driver = {
225 .driver = { 231 .driver = {
226 .name = "fsl-fec-mdio", 232 .name = "fsl-fec-mdio",
227 .owner = THIS_MODULE, 233 .owner = THIS_MODULE,
@@ -233,12 +239,12 @@ static struct of_platform_driver fs_enet_fec_mdio_driver = {
233 239
234static int fs_enet_mdio_fec_init(void) 240static int fs_enet_mdio_fec_init(void)
235{ 241{
236 return of_register_platform_driver(&fs_enet_fec_mdio_driver); 242 return platform_driver_register(&fs_enet_fec_mdio_driver);
237} 243}
238 244
239static void fs_enet_mdio_fec_exit(void) 245static void fs_enet_mdio_fec_exit(void)
240{ 246{
241 of_unregister_platform_driver(&fs_enet_fec_mdio_driver); 247 platform_driver_unregister(&fs_enet_fec_mdio_driver);
242} 248}
243 249
244module_init(fs_enet_mdio_fec_init); 250module_init(fs_enet_mdio_fec_init);