aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/fmvj18x_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/net/pcmcia/fmvj18x_cs.c
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff)
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 34bf963b1296..3f0ace4ed732 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -116,7 +116,7 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN,
116 driver specific data structure 116 driver specific data structure
117*/ 117*/
118typedef struct local_info_t { 118typedef struct local_info_t {
119 dev_link_t link; 119 struct pcmcia_device *p_dev;
120 dev_node_t node; 120 dev_node_t node;
121 struct net_device_stats stats; 121 struct net_device_stats stats;
122 long open_time; 122 long open_time;
@@ -231,8 +231,8 @@ typedef struct local_info_t {
231static int fmvj18x_attach(struct pcmcia_device *p_dev) 231static int fmvj18x_attach(struct pcmcia_device *p_dev)
232{ 232{
233 local_info_t *lp; 233 local_info_t *lp;
234 dev_link_t *link;
235 struct net_device *dev; 234 struct net_device *dev;
235 dev_link_t *link = dev_to_instance(p_dev);
236 236
237 DEBUG(0, "fmvj18x_attach()\n"); 237 DEBUG(0, "fmvj18x_attach()\n");
238 238
@@ -241,8 +241,8 @@ static int fmvj18x_attach(struct pcmcia_device *p_dev)
241 if (!dev) 241 if (!dev)
242 return -ENOMEM; 242 return -ENOMEM;
243 lp = netdev_priv(dev); 243 lp = netdev_priv(dev);
244 link = &lp->link;
245 link->priv = dev; 244 link->priv = dev;
245 lp->p_dev = p_dev;
246 246
247 /* The io structure describes IO port mapping */ 247 /* The io structure describes IO port mapping */
248 link->io.NumPorts1 = 32; 248 link->io.NumPorts1 = 32;
@@ -273,9 +273,6 @@ static int fmvj18x_attach(struct pcmcia_device *p_dev)
273#endif 273#endif
274 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 274 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
275 275
276 link->handle = p_dev;
277 p_dev->instance = link;
278
279 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 276 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
280 fmvj18x_config(link); 277 fmvj18x_config(link);
281 278
@@ -291,7 +288,7 @@ static void fmvj18x_detach(struct pcmcia_device *p_dev)
291 288
292 DEBUG(0, "fmvj18x_detach(0x%p)\n", link); 289 DEBUG(0, "fmvj18x_detach(0x%p)\n", link);
293 290
294 if (link->dev) 291 if (link->dev_node)
295 unregister_netdev(dev); 292 unregister_netdev(dev);
296 293
297 if (link->state & DEV_CONFIG) 294 if (link->state & DEV_CONFIG)
@@ -539,13 +536,13 @@ static void fmvj18x_config(dev_link_t *link)
539 } 536 }
540 537
541 lp->cardtype = cardtype; 538 lp->cardtype = cardtype;
542 link->dev = &lp->node; 539 link->dev_node = &lp->node;
543 link->state &= ~DEV_CONFIG_PENDING; 540 link->state &= ~DEV_CONFIG_PENDING;
544 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 541 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
545 542
546 if (register_netdev(dev) != 0) { 543 if (register_netdev(dev) != 0) {
547 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); 544 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
548 link->dev = NULL; 545 link->dev_node = NULL;
549 goto failed; 546 goto failed;
550 } 547 }
551 548
@@ -1125,7 +1122,7 @@ static int fjn_config(struct net_device *dev, struct ifmap *map){
1125static int fjn_open(struct net_device *dev) 1122static int fjn_open(struct net_device *dev)
1126{ 1123{
1127 struct local_info_t *lp = netdev_priv(dev); 1124 struct local_info_t *lp = netdev_priv(dev);
1128 dev_link_t *link = &lp->link; 1125 dev_link_t *link = lp->p_dev;
1129 1126
1130 DEBUG(4, "fjn_open('%s').\n", dev->name); 1127 DEBUG(4, "fjn_open('%s').\n", dev->name);
1131 1128
@@ -1150,7 +1147,7 @@ static int fjn_open(struct net_device *dev)
1150static int fjn_close(struct net_device *dev) 1147static int fjn_close(struct net_device *dev)
1151{ 1148{
1152 struct local_info_t *lp = netdev_priv(dev); 1149 struct local_info_t *lp = netdev_priv(dev);
1153 dev_link_t *link = &lp->link; 1150 dev_link_t *link = lp->p_dev;
1154 kio_addr_t ioaddr = dev->base_addr; 1151 kio_addr_t ioaddr = dev->base_addr;
1155 1152
1156 DEBUG(4, "fjn_close('%s').\n", dev->name); 1153 DEBUG(4, "fjn_close('%s').\n", dev->name);