aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/teles_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/teles_cs.c')
-rw-r--r--drivers/isdn/hisax/teles_cs.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index cd0f86f0975b..f956fceb9db2 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -107,18 +107,7 @@ static dev_info_t dev_info = "teles_cs";
107 device numbers are used to derive the corresponding array index. 107 device numbers are used to derive the corresponding array index.
108*/ 108*/
109 109
110static dev_link_t *dev_list = NULL;
111
112/* 110/*
113 A dev_link_t structure has fields for most things that are needed
114 to keep track of a socket, but there will usually be some device
115 specific information that also needs to be kept track of. The
116 'priv' pointer in a dev_link_t structure can be used to point to
117 a device-specific private data structure, like this.
118
119 To simplify the data structure handling, we actually include the
120 dev_link_t structure in the device's private data structure.
121
122 A driver needs to provide a dev_node_t structure for each device 111 A driver needs to provide a dev_node_t structure for each device
123 on a card. In some cases, there is only one device per card (for 112 on a card. In some cases, there is only one device per card (for
124 example, ethernet cards, modems). In other cases, there may be 113 example, ethernet cards, modems). In other cases, there may be
@@ -189,8 +178,7 @@ static dev_link_t *teles_attach(void)
189 link->conf.IntType = INT_MEMORY_AND_IO; 178 link->conf.IntType = INT_MEMORY_AND_IO;
190 179
191 /* Register with Card Services */ 180 /* Register with Card Services */
192 link->next = dev_list; 181 link->next = NULL;
193 dev_list = link;
194 client_reg.dev_info = &dev_info; 182 client_reg.dev_info = &dev_info;
195 client_reg.Version = 0x0210; 183 client_reg.Version = 0x0210;
196 client_reg.event_callback_args.client_data = link; 184 client_reg.event_callback_args.client_data = link;
@@ -216,24 +204,15 @@ static dev_link_t *teles_attach(void)
216static void teles_detach(struct pcmcia_device *p_dev) 204static void teles_detach(struct pcmcia_device *p_dev)
217{ 205{
218 dev_link_t *link = dev_to_instance(p_dev); 206 dev_link_t *link = dev_to_instance(p_dev);
219 dev_link_t **linkp;
220 local_info_t *info = link->priv; 207 local_info_t *info = link->priv;
221 208
222 DEBUG(0, "teles_detach(0x%p)\n", link); 209 DEBUG(0, "teles_detach(0x%p)\n", link);
223 210
224 /* Locate device structure */
225 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
226 if (*linkp == link) break;
227 if (*linkp == NULL)
228 return;
229
230 if (link->state & DEV_CONFIG) { 211 if (link->state & DEV_CONFIG) {
231 info->busy = 1; 212 info->busy = 1;
232 teles_cs_release(link); 213 teles_cs_release(link);
233 } 214 }
234 215
235 /* Unlink device structure and free it */
236 *linkp = link->next;
237 kfree(info); 216 kfree(info);
238 217
239} /* teles_detach */ 218} /* teles_detach */
@@ -506,7 +485,6 @@ static int __init init_teles_cs(void)
506static void __exit exit_teles_cs(void) 485static void __exit exit_teles_cs(void)
507{ 486{
508 pcmcia_unregister_driver(&teles_cs_driver); 487 pcmcia_unregister_driver(&teles_cs_driver);
509 BUG_ON(dev_list != NULL);
510} 488}
511 489
512module_init(init_teles_cs); 490module_init(init_teles_cs);