aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/parport_cs.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 063d22de9743..763f91a79085 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -95,7 +95,6 @@ static int parport_event(event_t event, int priority,
95 event_callback_args_t *args); 95 event_callback_args_t *args);
96 96
97static dev_info_t dev_info = "parport_cs"; 97static dev_info_t dev_info = "parport_cs";
98static dev_link_t *dev_list = NULL;
99 98
100/*====================================================================== 99/*======================================================================
101 100
@@ -129,8 +128,7 @@ static dev_link_t *parport_attach(void)
129 link->conf.IntType = INT_MEMORY_AND_IO; 128 link->conf.IntType = INT_MEMORY_AND_IO;
130 129
131 /* Register with Card Services */ 130 /* Register with Card Services */
132 link->next = dev_list; 131 link->next = NULL;
133 dev_list = link;
134 client_reg.dev_info = &dev_info; 132 client_reg.dev_info = &dev_info;
135 client_reg.Version = 0x0210; 133 client_reg.Version = 0x0210;
136 client_reg.event_callback_args.client_data = link; 134 client_reg.event_callback_args.client_data = link;
@@ -156,21 +154,12 @@ static dev_link_t *parport_attach(void)
156static void parport_detach(struct pcmcia_device *p_dev) 154static void parport_detach(struct pcmcia_device *p_dev)
157{ 155{
158 dev_link_t *link = dev_to_instance(p_dev); 156 dev_link_t *link = dev_to_instance(p_dev);
159 dev_link_t **linkp;
160 157
161 DEBUG(0, "parport_detach(0x%p)\n", link); 158 DEBUG(0, "parport_detach(0x%p)\n", link);
162 159
163 /* Locate device structure */
164 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
165 if (*linkp == link) break;
166 if (*linkp == NULL)
167 return;
168
169 if (link->state & DEV_CONFIG) 160 if (link->state & DEV_CONFIG)
170 parport_cs_release(link); 161 parport_cs_release(link);
171 162
172 /* Unlink, free device structure */
173 *linkp = link->next;
174 kfree(link->priv); 163 kfree(link->priv);
175} /* parport_detach */ 164} /* parport_detach */
176 165
@@ -391,7 +380,6 @@ static int __init init_parport_cs(void)
391static void __exit exit_parport_cs(void) 380static void __exit exit_parport_cs(void)
392{ 381{
393 pcmcia_unregister_driver(&parport_cs_driver); 382 pcmcia_unregister_driver(&parport_cs_driver);
394 BUG_ON(dev_list != NULL);
395} 383}
396 384
397module_init(init_parport_cs); 385module_init(init_parport_cs);