aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/smc91c92_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:25:35 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:03:20 -0500
commitb463581154f3f3eecda27cae60df813fefcd84d3 (patch)
tree5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/net/pcmcia/smc91c92_cs.c
parentf3990715589d378a2d3aa9b8accd78bb4a2378b7 (diff)
[PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most cases, unused. Therefore, remove it from many drivers. 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.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 6cb5198d6094..9eb5cecfb2f5 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -104,8 +104,6 @@ static const char *version =
104 104
105static dev_info_t dev_info = "smc91c92_cs"; 105static dev_info_t dev_info = "smc91c92_cs";
106 106
107static dev_link_t *dev_list;
108
109struct smc_private { 107struct smc_private {
110 dev_link_t link; 108 dev_link_t link;
111 spinlock_t lock; 109 spinlock_t lock;
@@ -367,8 +365,7 @@ static dev_link_t *smc91c92_attach(void)
367 smc->mii_if.reg_num_mask = 0x1f; 365 smc->mii_if.reg_num_mask = 0x1f;
368 366
369 /* Register with Card Services */ 367 /* Register with Card Services */
370 link->next = dev_list; 368 link->next = NULL;
371 dev_list = link;
372 client_reg.dev_info = &dev_info; 369 client_reg.dev_info = &dev_info;
373 client_reg.Version = 0x0210; 370 client_reg.Version = 0x0210;
374 client_reg.event_callback_args.client_data = link; 371 client_reg.event_callback_args.client_data = link;
@@ -395,24 +392,15 @@ static void smc91c92_detach(struct pcmcia_device *p_dev)
395{ 392{
396 dev_link_t *link = dev_to_instance(p_dev); 393 dev_link_t *link = dev_to_instance(p_dev);
397 struct net_device *dev = link->priv; 394 struct net_device *dev = link->priv;
398 dev_link_t **linkp;
399 395
400 DEBUG(0, "smc91c92_detach(0x%p)\n", link); 396 DEBUG(0, "smc91c92_detach(0x%p)\n", link);
401 397
402 /* Locate device structure */
403 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
404 if (*linkp == link) break;
405 if (*linkp == NULL)
406 return;
407
408 if (link->dev) 398 if (link->dev)
409 unregister_netdev(dev); 399 unregister_netdev(dev);
410 400
411 if (link->state & DEV_CONFIG) 401 if (link->state & DEV_CONFIG)
412 smc91c92_release(link); 402 smc91c92_release(link);
413 403
414 /* Unlink device structure, free bits */
415 *linkp = link->next;
416 free_netdev(dev); 404 free_netdev(dev);
417} /* smc91c92_detach */ 405} /* smc91c92_detach */
418 406
@@ -2377,7 +2365,6 @@ static int __init init_smc91c92_cs(void)
2377static void __exit exit_smc91c92_cs(void) 2365static void __exit exit_smc91c92_cs(void)
2378{ 2366{
2379 pcmcia_unregister_driver(&smc91c92_cs_driver); 2367 pcmcia_unregister_driver(&smc91c92_cs_driver);
2380 BUG_ON(dev_list != NULL);
2381} 2368}
2382 2369
2383module_init(init_smc91c92_cs); 2370module_init(init_smc91c92_cs);