aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/smc91c92_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/smc91c92_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/smc91c92_cs.c')
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index b46b7e14839..a18b02a9a68 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -104,7 +104,7 @@ static const char *version =
104#define MEMORY_WAIT_TIME 8 104#define MEMORY_WAIT_TIME 8
105 105
106struct smc_private { 106struct smc_private {
107 dev_link_t link; 107 struct pcmcia_device *p_dev;
108 spinlock_t lock; 108 spinlock_t lock;
109 u_short manfid; 109 u_short manfid;
110 u_short cardid; 110 u_short cardid;
@@ -312,8 +312,8 @@ static struct ethtool_ops ethtool_ops;
312static int smc91c92_attach(struct pcmcia_device *p_dev) 312static int smc91c92_attach(struct pcmcia_device *p_dev)
313{ 313{
314 struct smc_private *smc; 314 struct smc_private *smc;
315 dev_link_t *link;
316 struct net_device *dev; 315 struct net_device *dev;
316 dev_link_t *link = dev_to_instance(p_dev);
317 317
318 DEBUG(0, "smc91c92_attach()\n"); 318 DEBUG(0, "smc91c92_attach()\n");
319 319
@@ -322,7 +322,7 @@ static int smc91c92_attach(struct pcmcia_device *p_dev)
322 if (!dev) 322 if (!dev)
323 return -ENOMEM; 323 return -ENOMEM;
324 smc = netdev_priv(dev); 324 smc = netdev_priv(dev);
325 link = &smc->link; 325 smc->p_dev = p_dev;
326 link->priv = dev; 326 link->priv = dev;
327 327
328 spin_lock_init(&smc->lock); 328 spin_lock_init(&smc->lock);
@@ -357,9 +357,6 @@ static int smc91c92_attach(struct pcmcia_device *p_dev)
357 smc->mii_if.phy_id_mask = 0x1f; 357 smc->mii_if.phy_id_mask = 0x1f;
358 smc->mii_if.reg_num_mask = 0x1f; 358 smc->mii_if.reg_num_mask = 0x1f;
359 359
360 link->handle = p_dev;
361 p_dev->instance = link;
362
363 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 360 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
364 smc91c92_config(link); 361 smc91c92_config(link);
365 362
@@ -382,7 +379,7 @@ static void smc91c92_detach(struct pcmcia_device *p_dev)
382 379
383 DEBUG(0, "smc91c92_detach(0x%p)\n", link); 380 DEBUG(0, "smc91c92_detach(0x%p)\n", link);
384 381
385 if (link->dev) 382 if (link->dev_node)
386 unregister_netdev(dev); 383 unregister_netdev(dev);
387 384
388 if (link->state & DEV_CONFIG) 385 if (link->state & DEV_CONFIG)
@@ -1120,13 +1117,13 @@ static void smc91c92_config(dev_link_t *link)
1120 SMC_SELECT_BANK(0); 1117 SMC_SELECT_BANK(0);
1121 } 1118 }
1122 1119
1123 link->dev = &smc->node; 1120 link->dev_node = &smc->node;
1124 link->state &= ~DEV_CONFIG_PENDING; 1121 link->state &= ~DEV_CONFIG_PENDING;
1125 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 1122 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
1126 1123
1127 if (register_netdev(dev) != 0) { 1124 if (register_netdev(dev) != 0) {
1128 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); 1125 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
1129 link->dev = NULL; 1126 link->dev_node = NULL;
1130 goto config_undo; 1127 goto config_undo;
1131 } 1128 }
1132 1129
@@ -1272,7 +1269,7 @@ static void smc_dump(struct net_device *dev)
1272static int smc_open(struct net_device *dev) 1269static int smc_open(struct net_device *dev)
1273{ 1270{
1274 struct smc_private *smc = netdev_priv(dev); 1271 struct smc_private *smc = netdev_priv(dev);
1275 dev_link_t *link = &smc->link; 1272 dev_link_t *link = smc->p_dev;
1276 1273
1277#ifdef PCMCIA_DEBUG 1274#ifdef PCMCIA_DEBUG
1278 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n", 1275 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n",
@@ -1309,7 +1306,7 @@ static int smc_open(struct net_device *dev)
1309static int smc_close(struct net_device *dev) 1306static int smc_close(struct net_device *dev)
1310{ 1307{
1311 struct smc_private *smc = netdev_priv(dev); 1308 struct smc_private *smc = netdev_priv(dev);
1312 dev_link_t *link = &smc->link; 1309 dev_link_t *link = smc->p_dev;
1313 kio_addr_t ioaddr = dev->base_addr; 1310 kio_addr_t ioaddr = dev->base_addr;
1314 1311
1315 DEBUG(0, "%s: smc_close(), status %4.4x.\n", 1312 DEBUG(0, "%s: smc_close(), status %4.4x.\n",