aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c7
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c9
-rw-r--r--drivers/net/fs_enet/mii-fec.c7
-rw-r--r--drivers/net/sunhme.c7
4 files changed, 21 insertions, 9 deletions
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index bd1d811c204f..5fedc3375562 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -247,8 +247,10 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
247} 247}
248#endif /* CONFIG_PPC_MPC512x */ 248#endif /* CONFIG_PPC_MPC512x */
249 249
250static struct of_device_id mpc5xxx_can_table[];
250static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) 251static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
251{ 252{
253 const struct of_device_id *match;
252 struct mpc5xxx_can_data *data; 254 struct mpc5xxx_can_data *data;
253 struct device_node *np = ofdev->dev.of_node; 255 struct device_node *np = ofdev->dev.of_node;
254 struct net_device *dev; 256 struct net_device *dev;
@@ -258,9 +260,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
258 int irq, mscan_clksrc = 0; 260 int irq, mscan_clksrc = 0;
259 int err = -ENOMEM; 261 int err = -ENOMEM;
260 262
261 if (!ofdev->dev.of_match) 263 match = of_match_device(mpc5xxx_can_table, &ofdev->dev);
264 if (!match)
262 return -EINVAL; 265 return -EINVAL;
263 data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data; 266 data = match->data;
264 267
265 base = of_iomap(np, 0); 268 base = of_iomap(np, 0);
266 if (!base) { 269 if (!base) {
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 24cb953900dd..5131e61c358c 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -998,8 +998,10 @@ static const struct net_device_ops fs_enet_netdev_ops = {
998#endif 998#endif
999}; 999};
1000 1000
1001static struct of_device_id fs_enet_match[];
1001static int __devinit fs_enet_probe(struct platform_device *ofdev) 1002static int __devinit fs_enet_probe(struct platform_device *ofdev)
1002{ 1003{
1004 const struct of_device_id *match;
1003 struct net_device *ndev; 1005 struct net_device *ndev;
1004 struct fs_enet_private *fep; 1006 struct fs_enet_private *fep;
1005 struct fs_platform_info *fpi; 1007 struct fs_platform_info *fpi;
@@ -1007,14 +1009,15 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev)
1007 const u8 *mac_addr; 1009 const u8 *mac_addr;
1008 int privsize, len, ret = -ENODEV; 1010 int privsize, len, ret = -ENODEV;
1009 1011
1010 if (!ofdev->dev.of_match) 1012 match = of_match_device(fs_enet_match, &ofdev->dev);
1013 if (!match)
1011 return -EINVAL; 1014 return -EINVAL;
1012 1015
1013 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL); 1016 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
1014 if (!fpi) 1017 if (!fpi)
1015 return -ENOMEM; 1018 return -ENOMEM;
1016 1019
1017 if (!IS_FEC(ofdev->dev.of_match)) { 1020 if (!IS_FEC(match)) {
1018 data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len); 1021 data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
1019 if (!data || len != 4) 1022 if (!data || len != 4)
1020 goto out_free_fpi; 1023 goto out_free_fpi;
@@ -1049,7 +1052,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev)
1049 fep->dev = &ofdev->dev; 1052 fep->dev = &ofdev->dev;
1050 fep->ndev = ndev; 1053 fep->ndev = ndev;
1051 fep->fpi = fpi; 1054 fep->fpi = fpi;
1052 fep->ops = ofdev->dev.of_match->data; 1055 fep->ops = match->data;
1053 1056
1054 ret = fep->ops->setup_data(ndev); 1057 ret = fep->ops->setup_data(ndev);
1055 if (ret) 1058 if (ret)
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index 7e840d373ab3..6a2e150e75bb 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -101,17 +101,20 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
101 return 0; 101 return 0;
102} 102}
103 103
104static struct of_device_id fs_enet_mdio_fec_match[];
104static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev) 105static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
105{ 106{
107 const struct of_device_id *match;
106 struct resource res; 108 struct resource res;
107 struct mii_bus *new_bus; 109 struct mii_bus *new_bus;
108 struct fec_info *fec; 110 struct fec_info *fec;
109 int (*get_bus_freq)(struct device_node *); 111 int (*get_bus_freq)(struct device_node *);
110 int ret = -ENOMEM, clock, speed; 112 int ret = -ENOMEM, clock, speed;
111 113
112 if (!ofdev->dev.of_match) 114 match = of_match_device(fs_enet_mdio_fec_match, &ofdev->dev);
115 if (!match)
113 return -EINVAL; 116 return -EINVAL;
114 get_bus_freq = ofdev->dev.of_match->data; 117 get_bus_freq = match->data;
115 118
116 new_bus = mdiobus_alloc(); 119 new_bus = mdiobus_alloc();
117 if (!new_bus) 120 if (!new_bus)
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index eb4f59fb01e9..bff2f7999ff0 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3237,15 +3237,18 @@ static void happy_meal_pci_exit(void)
3237#endif 3237#endif
3238 3238
3239#ifdef CONFIG_SBUS 3239#ifdef CONFIG_SBUS
3240static const struct of_device_id hme_sbus_match[];
3240static int __devinit hme_sbus_probe(struct platform_device *op) 3241static int __devinit hme_sbus_probe(struct platform_device *op)
3241{ 3242{
3243 const struct of_device_id *match;
3242 struct device_node *dp = op->dev.of_node; 3244 struct device_node *dp = op->dev.of_node;
3243 const char *model = of_get_property(dp, "model", NULL); 3245 const char *model = of_get_property(dp, "model", NULL);
3244 int is_qfe; 3246 int is_qfe;
3245 3247
3246 if (!op->dev.of_match) 3248 match = of_match_device(hme_sbus_match, &op->dev);
3249 if (!match)
3247 return -EINVAL; 3250 return -EINVAL;
3248 is_qfe = (op->dev.of_match->data != NULL); 3251 is_qfe = (match->data != NULL);
3249 3252
3250 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe")) 3253 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))
3251 is_qfe = 1; 3254 is_qfe = 1;