aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/elsa_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:25:35 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:03:20 -0500
commitb463581154f3f3eecda27cae60df813fefcd84d3 (patch)
tree5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/isdn/hisax/elsa_cs.c
parentf3990715589d378a2d3aa9b8accd78bb4a2378b7 (diff)
[PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most cases, unused. Therefore, remove it from many drivers. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn/hisax/elsa_cs.c')
-rw-r--r--drivers/isdn/hisax/elsa_cs.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 48cc677249f1..a0c5bad7bc6b 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -126,18 +126,7 @@ static dev_info_t dev_info = "elsa_cs";
126 device numbers are used to derive the corresponding array index. 126 device numbers are used to derive the corresponding array index.
127*/ 127*/
128 128
129static dev_link_t *dev_list = NULL;
130
131/* 129/*
132 A dev_link_t structure has fields for most things that are needed
133 to keep track of a socket, but there will usually be some device
134 specific information that also needs to be kept track of. The
135 'priv' pointer in a dev_link_t structure can be used to point to
136 a device-specific private data structure, like this.
137
138 To simplify the data structure handling, we actually include the
139 dev_link_t structure in the device's private data structure.
140
141 A driver needs to provide a dev_node_t structure for each device 130 A driver needs to provide a dev_node_t structure for each device
142 on a card. In some cases, there is only one device per card (for 131 on a card. In some cases, there is only one device per card (for
143 example, ethernet cards, modems). In other cases, there may be 132 example, ethernet cards, modems). In other cases, there may be
@@ -208,8 +197,7 @@ static dev_link_t *elsa_cs_attach(void)
208 link->conf.IntType = INT_MEMORY_AND_IO; 197 link->conf.IntType = INT_MEMORY_AND_IO;
209 198
210 /* Register with Card Services */ 199 /* Register with Card Services */
211 link->next = dev_list; 200 link->next = NULL;
212 dev_list = link;
213 client_reg.dev_info = &dev_info; 201 client_reg.dev_info = &dev_info;
214 client_reg.Version = 0x0210; 202 client_reg.Version = 0x0210;
215 client_reg.event_callback_args.client_data = link; 203 client_reg.event_callback_args.client_data = link;
@@ -235,24 +223,15 @@ static dev_link_t *elsa_cs_attach(void)
235static void elsa_cs_detach(struct pcmcia_device *p_dev) 223static void elsa_cs_detach(struct pcmcia_device *p_dev)
236{ 224{
237 dev_link_t *link = dev_to_instance(p_dev); 225 dev_link_t *link = dev_to_instance(p_dev);
238 dev_link_t **linkp;
239 local_info_t *info = link->priv; 226 local_info_t *info = link->priv;
240 227
241 DEBUG(0, "elsa_cs_detach(0x%p)\n", link); 228 DEBUG(0, "elsa_cs_detach(0x%p)\n", link);
242 229
243 /* Locate device structure */
244 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
245 if (*linkp == link) break;
246 if (*linkp == NULL)
247 return;
248
249 if (link->state & DEV_CONFIG) { 230 if (link->state & DEV_CONFIG) {
250 ((local_info_t*)link->priv)->busy = 1; 231 info->busy = 1;
251 elsa_cs_release(link); 232 elsa_cs_release(link);
252 } 233 }
253 234
254 /* Unlink device structure and free it */
255 *linkp = link->next;
256 kfree(info); 235 kfree(info);
257 236
258} /* elsa_cs_detach */ 237} /* elsa_cs_detach */
@@ -526,7 +505,6 @@ static int __init init_elsa_cs(void)
526static void __exit exit_elsa_cs(void) 505static void __exit exit_elsa_cs(void)
527{ 506{
528 pcmcia_unregister_driver(&elsa_cs_driver); 507 pcmcia_unregister_driver(&elsa_cs_driver);
529 BUG_ON(dev_list != NULL);
530} 508}
531 509
532module_init(init_elsa_cs); 510module_init(init_elsa_cs);