diff options
Diffstat (limited to 'drivers/net/pcmcia/nmclan_cs.c')
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 011ceb090320..0c9cb9f49a81 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -389,7 +389,6 @@ DRV_NAME " " DRV_VERSION " (Roger C. Pao)"; | |||
389 | #endif | 389 | #endif |
390 | 390 | ||
391 | static dev_info_t dev_info="nmclan_cs"; | 391 | static dev_info_t dev_info="nmclan_cs"; |
392 | static dev_link_t *dev_list; | ||
393 | 392 | ||
394 | static char *if_names[]={ | 393 | static char *if_names[]={ |
395 | "Auto", "10baseT", "BNC", | 394 | "Auto", "10baseT", "BNC", |
@@ -498,8 +497,7 @@ static dev_link_t *nmclan_attach(void) | |||
498 | #endif | 497 | #endif |
499 | 498 | ||
500 | /* Register with Card Services */ | 499 | /* Register with Card Services */ |
501 | link->next = dev_list; | 500 | link->next = NULL; |
502 | dev_list = link; | ||
503 | client_reg.dev_info = &dev_info; | 501 | client_reg.dev_info = &dev_info; |
504 | client_reg.Version = 0x0210; | 502 | client_reg.Version = 0x0210; |
505 | client_reg.event_callback_args.client_data = link; | 503 | client_reg.event_callback_args.client_data = link; |
@@ -525,24 +523,15 @@ static void nmclan_detach(struct pcmcia_device *p_dev) | |||
525 | { | 523 | { |
526 | dev_link_t *link = dev_to_instance(p_dev); | 524 | dev_link_t *link = dev_to_instance(p_dev); |
527 | struct net_device *dev = link->priv; | 525 | struct net_device *dev = link->priv; |
528 | dev_link_t **linkp; | ||
529 | 526 | ||
530 | DEBUG(0, "nmclan_detach(0x%p)\n", link); | 527 | DEBUG(0, "nmclan_detach(0x%p)\n", link); |
531 | 528 | ||
532 | /* Locate device structure */ | ||
533 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
534 | if (*linkp == link) break; | ||
535 | if (*linkp == NULL) | ||
536 | return; | ||
537 | |||
538 | if (link->dev) | 529 | if (link->dev) |
539 | unregister_netdev(dev); | 530 | unregister_netdev(dev); |
540 | 531 | ||
541 | if (link->state & DEV_CONFIG) | 532 | if (link->state & DEV_CONFIG) |
542 | nmclan_release(link); | 533 | nmclan_release(link); |
543 | 534 | ||
544 | /* Unlink device structure, free bits */ | ||
545 | *linkp = link->next; | ||
546 | free_netdev(dev); | 535 | free_netdev(dev); |
547 | } /* nmclan_detach */ | 536 | } /* nmclan_detach */ |
548 | 537 | ||
@@ -1700,7 +1689,6 @@ static int __init init_nmclan_cs(void) | |||
1700 | static void __exit exit_nmclan_cs(void) | 1689 | static void __exit exit_nmclan_cs(void) |
1701 | { | 1690 | { |
1702 | pcmcia_unregister_driver(&nmclan_cs_driver); | 1691 | pcmcia_unregister_driver(&nmclan_cs_driver); |
1703 | BUG_ON(dev_list != NULL); | ||
1704 | } | 1692 | } |
1705 | 1693 | ||
1706 | module_init(init_nmclan_cs); | 1694 | module_init(init_nmclan_cs); |