diff options
Diffstat (limited to 'drivers/net/pcmcia/pcnet_cs.c')
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index fb3e411d6daf..b35c951fc6fa 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -124,7 +124,6 @@ static dev_link_t *pcnet_attach(void); | |||
124 | static void pcnet_detach(struct pcmcia_device *p_dev); | 124 | static void pcnet_detach(struct pcmcia_device *p_dev); |
125 | 125 | ||
126 | static dev_info_t dev_info = "pcnet_cs"; | 126 | static dev_info_t dev_info = "pcnet_cs"; |
127 | static dev_link_t *dev_list; | ||
128 | 127 | ||
129 | /*====================================================================*/ | 128 | /*====================================================================*/ |
130 | 129 | ||
@@ -272,8 +271,7 @@ static dev_link_t *pcnet_attach(void) | |||
272 | dev->set_config = &set_config; | 271 | dev->set_config = &set_config; |
273 | 272 | ||
274 | /* Register with Card Services */ | 273 | /* Register with Card Services */ |
275 | link->next = dev_list; | 274 | link->next = NULL; |
276 | dev_list = link; | ||
277 | client_reg.dev_info = &dev_info; | 275 | client_reg.dev_info = &dev_info; |
278 | client_reg.Version = 0x0210; | 276 | client_reg.Version = 0x0210; |
279 | client_reg.event_callback_args.client_data = link; | 277 | client_reg.event_callback_args.client_data = link; |
@@ -300,24 +298,15 @@ static void pcnet_detach(struct pcmcia_device *p_dev) | |||
300 | { | 298 | { |
301 | dev_link_t *link = dev_to_instance(p_dev); | 299 | dev_link_t *link = dev_to_instance(p_dev); |
302 | struct net_device *dev = link->priv; | 300 | struct net_device *dev = link->priv; |
303 | dev_link_t **linkp; | ||
304 | 301 | ||
305 | DEBUG(0, "pcnet_detach(0x%p)\n", link); | 302 | DEBUG(0, "pcnet_detach(0x%p)\n", link); |
306 | 303 | ||
307 | /* Locate device structure */ | ||
308 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
309 | if (*linkp == link) break; | ||
310 | if (*linkp == NULL) | ||
311 | return; | ||
312 | |||
313 | if (link->dev) | 304 | if (link->dev) |
314 | unregister_netdev(dev); | 305 | unregister_netdev(dev); |
315 | 306 | ||
316 | if (link->state & DEV_CONFIG) | 307 | if (link->state & DEV_CONFIG) |
317 | pcnet_release(link); | 308 | pcnet_release(link); |
318 | 309 | ||
319 | /* Unlink device structure, free bits */ | ||
320 | *linkp = link->next; | ||
321 | free_netdev(dev); | 310 | free_netdev(dev); |
322 | } /* pcnet_detach */ | 311 | } /* pcnet_detach */ |
323 | 312 | ||
@@ -1864,7 +1853,6 @@ static void __exit exit_pcnet_cs(void) | |||
1864 | { | 1853 | { |
1865 | DEBUG(0, "pcnet_cs: unloading\n"); | 1854 | DEBUG(0, "pcnet_cs: unloading\n"); |
1866 | pcmcia_unregister_driver(&pcnet_driver); | 1855 | pcmcia_unregister_driver(&pcnet_driver); |
1867 | BUG_ON(dev_list != NULL); | ||
1868 | } | 1856 | } |
1869 | 1857 | ||
1870 | module_init(init_pcnet_cs); | 1858 | module_init(init_pcnet_cs); |