aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco_cs.c')
-rw-r--r--drivers/net/wireless/orinoco_cs.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 00679b6c87c1..bfeeef49f0b3 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -69,12 +69,6 @@ struct orinoco_pccard {
69 unsigned long hard_reset_in_progress; 69 unsigned long hard_reset_in_progress;
70}; 70};
71 71
72/*
73 * A linked list of "instances" of the device. Each actual PCMCIA
74 * card corresponds to one device instance, and is described by one
75 * dev_link_t structure (defined in ds.h).
76 */
77static dev_link_t *dev_list; /* = NULL */
78 72
79/********************************************************************/ 73/********************************************************************/
80/* Function prototypes */ 74/* Function prototypes */
@@ -154,9 +148,7 @@ orinoco_cs_attach(void)
154 link->conf.IntType = INT_MEMORY_AND_IO; 148 link->conf.IntType = INT_MEMORY_AND_IO;
155 149
156 /* Register with Card Services */ 150 /* Register with Card Services */
157 /* FIXME: need a lock? */ 151 link->next = NULL;
158 link->next = dev_list;
159 dev_list = link;
160 152
161 client_reg.dev_info = &dev_info; 153 client_reg.dev_info = &dev_info;
162 client_reg.Version = 0x0210; /* FIXME: what does this mean? */ 154 client_reg.Version = 0x0210; /* FIXME: what does this mean? */
@@ -181,21 +173,11 @@ orinoco_cs_attach(void)
181static void orinoco_cs_detach(struct pcmcia_device *p_dev) 173static void orinoco_cs_detach(struct pcmcia_device *p_dev)
182{ 174{
183 dev_link_t *link = dev_to_instance(p_dev); 175 dev_link_t *link = dev_to_instance(p_dev);
184 dev_link_t **linkp;
185 struct net_device *dev = link->priv; 176 struct net_device *dev = link->priv;
186 177
187 /* Locate device structure */
188 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
189 if (*linkp == link)
190 break;
191
192 BUG_ON(*linkp == NULL);
193
194 if (link->state & DEV_CONFIG) 178 if (link->state & DEV_CONFIG)
195 orinoco_cs_release(link); 179 orinoco_cs_release(link);
196 180
197 /* Unlink device structure, and free it */
198 *linkp = link->next;
199 DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev); 181 DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev);
200 if (link->dev) { 182 if (link->dev) {
201 DEBUG(0, PFX "About to unregister net device %p\n", 183 DEBUG(0, PFX "About to unregister net device %p\n",
@@ -678,7 +660,6 @@ static void __exit
678exit_orinoco_cs(void) 660exit_orinoco_cs(void)
679{ 661{
680 pcmcia_unregister_driver(&orinoco_driver); 662 pcmcia_unregister_driver(&orinoco_driver);
681 BUG_ON(dev_list != NULL);
682} 663}
683 664
684module_init(init_orinoco_cs); 665module_init(init_orinoco_cs);