aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/xirc2ps_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/xirc2ps_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/xirc2ps_cs.c')
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 804e56771baf..8c8cc40bbb7d 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -331,15 +331,7 @@ static dev_info_t dev_info = "xirc2ps_cs";
331 * device numbers are used to derive the corresponding array index. 331 * device numbers are used to derive the corresponding array index.
332 */ 332 */
333 333
334static dev_link_t *dev_list;
335
336/**************** 334/****************
337 * A dev_link_t structure has fields for most things that are needed
338 * to keep track of a socket, but there will usually be some device
339 * specific information that also needs to be kept track of. The
340 * 'priv' pointer in a dev_link_t structure can be used to point to
341 * a device-specific private data structure, like this.
342 *
343 * A driver needs to provide a dev_node_t structure for each device 335 * A driver needs to provide a dev_node_t structure for each device
344 * on a card. In some cases, there is only one device per card (for 336 * on a card. In some cases, there is only one device per card (for
345 * example, ethernet cards, modems). In other cases, there may be 337 * example, ethernet cards, modems). In other cases, there may be
@@ -615,8 +607,7 @@ xirc2ps_attach(void)
615#endif 607#endif
616 608
617 /* Register with Card Services */ 609 /* Register with Card Services */
618 link->next = dev_list; 610 link->next = NULL;
619 dev_list = link;
620 client_reg.dev_info = &dev_info; 611 client_reg.dev_info = &dev_info;
621 client_reg.Version = 0x0210; 612 client_reg.Version = 0x0210;
622 client_reg.event_callback_args.client_data = link; 613 client_reg.event_callback_args.client_data = link;
@@ -641,27 +632,15 @@ xirc2ps_detach(struct pcmcia_device *p_dev)
641{ 632{
642 dev_link_t *link = dev_to_instance(p_dev); 633 dev_link_t *link = dev_to_instance(p_dev);
643 struct net_device *dev = link->priv; 634 struct net_device *dev = link->priv;
644 dev_link_t **linkp;
645 635
646 DEBUG(0, "detach(0x%p)\n", link); 636 DEBUG(0, "detach(0x%p)\n", link);
647 637
648 /* Locate device structure */
649 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
650 if (*linkp == link)
651 break;
652 if (!*linkp) {
653 DEBUG(0, "detach(0x%p): dev_link lost\n", link);
654 return;
655 }
656
657 if (link->dev) 638 if (link->dev)
658 unregister_netdev(dev); 639 unregister_netdev(dev);
659 640
660 if (link->state & DEV_CONFIG) 641 if (link->state & DEV_CONFIG)
661 xirc2ps_release(link); 642 xirc2ps_release(link);
662 643
663 /* Unlink device structure, free it */
664 *linkp = link->next;
665 free_netdev(dev); 644 free_netdev(dev);
666} /* xirc2ps_detach */ 645} /* xirc2ps_detach */
667 646
@@ -2020,7 +1999,6 @@ static void __exit
2020exit_xirc2ps_cs(void) 1999exit_xirc2ps_cs(void)
2021{ 2000{
2022 pcmcia_unregister_driver(&xirc2ps_cs_driver); 2001 pcmcia_unregister_driver(&xirc2ps_cs_driver);
2023 BUG_ON(dev_list != NULL);
2024} 2002}
2025 2003
2026module_init(init_xirc2ps_cs); 2004module_init(init_xirc2ps_cs);