aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/synclink_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/synclink_cs.c')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 34597144d9c1..dc38b1d0a725 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -492,7 +492,6 @@ static dev_link_t *mgslpc_attach(void);
492static void mgslpc_detach(struct pcmcia_device *p_dev); 492static void mgslpc_detach(struct pcmcia_device *p_dev);
493 493
494static dev_info_t dev_info = "synclink_cs"; 494static dev_info_t dev_info = "synclink_cs";
495static dev_link_t *dev_list = NULL;
496 495
497/* 496/*
498 * 1st function defined in .text section. Calling this function in 497 * 1st function defined in .text section. Calling this function in
@@ -588,8 +587,7 @@ static dev_link_t *mgslpc_attach(void)
588 link->conf.IntType = INT_MEMORY_AND_IO; 587 link->conf.IntType = INT_MEMORY_AND_IO;
589 588
590 /* Register with Card Services */ 589 /* Register with Card Services */
591 link->next = dev_list; 590 link->next = NULL;
592 dev_list = link;
593 591
594 client_reg.dev_info = &dev_info; 592 client_reg.dev_info = &dev_info;
595 client_reg.Version = 0x0210; 593 client_reg.Version = 0x0210;
@@ -741,24 +739,15 @@ static void mgslpc_release(u_long arg)
741static void mgslpc_detach(struct pcmcia_device *p_dev) 739static void mgslpc_detach(struct pcmcia_device *p_dev)
742{ 740{
743 dev_link_t *link = dev_to_instance(p_dev); 741 dev_link_t *link = dev_to_instance(p_dev);
744 dev_link_t **linkp;
745 742
746 if (debug_level >= DEBUG_LEVEL_INFO) 743 if (debug_level >= DEBUG_LEVEL_INFO)
747 printk("mgslpc_detach(0x%p)\n", link); 744 printk("mgslpc_detach(0x%p)\n", link);
748 745
749 /* find device */
750 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
751 if (*linkp == link) break;
752 if (*linkp == NULL)
753 return;
754
755 if (link->state & DEV_CONFIG) { 746 if (link->state & DEV_CONFIG) {
756 ((MGSLPC_INFO *)link->priv)->stop = 1; 747 ((MGSLPC_INFO *)link->priv)->stop = 1;
757 mgslpc_release((u_long)link); 748 mgslpc_release((u_long)link);
758 } 749 }
759 750
760 /* Unlink device structure, and free it */
761 *linkp = link->next;
762 mgslpc_remove_device((MGSLPC_INFO *)link->priv); 751 mgslpc_remove_device((MGSLPC_INFO *)link->priv);
763} 752}
764 753
@@ -3131,7 +3120,6 @@ static void synclink_cs_cleanup(void)
3131 } 3120 }
3132 3121
3133 pcmcia_unregister_driver(&mgslpc_driver); 3122 pcmcia_unregister_driver(&mgslpc_driver);
3134 BUG_ON(dev_list != NULL);
3135} 3123}
3136 3124
3137static int __init synclink_cs_init(void) 3125static int __init synclink_cs_init(void)