aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/sedlbauer_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/sedlbauer_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/sedlbauer_cs.c')
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index d2386f6867b7..814b32a9ef3b 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -134,18 +134,7 @@ static dev_info_t dev_info = "sedlbauer_cs";
134 device numbers are used to derive the corresponding array index. 134 device numbers are used to derive the corresponding array index.
135*/ 135*/
136 136
137static dev_link_t *dev_list = NULL;
138
139/* 137/*
140 A dev_link_t structure has fields for most things that are needed
141 to keep track of a socket, but there will usually be some device
142 specific information that also needs to be kept track of. The
143 'priv' pointer in a dev_link_t structure can be used to point to
144 a device-specific private data structure, like this.
145
146 To simplify the data structure handling, we actually include the
147 dev_link_t structure in the device's private data structure.
148
149 A driver needs to provide a dev_node_t structure for each device 138 A driver needs to provide a dev_node_t structure for each device
150 on a card. In some cases, there is only one device per card (for 139 on a card. In some cases, there is only one device per card (for
151 example, ethernet cards, modems). In other cases, there may be 140 example, ethernet cards, modems). In other cases, there may be
@@ -222,8 +211,7 @@ static dev_link_t *sedlbauer_attach(void)
222 link->conf.IntType = INT_MEMORY_AND_IO; 211 link->conf.IntType = INT_MEMORY_AND_IO;
223 212
224 /* Register with Card Services */ 213 /* Register with Card Services */
225 link->next = dev_list; 214 link->next = NULL;
226 dev_list = link;
227 client_reg.dev_info = &dev_info; 215 client_reg.dev_info = &dev_info;
228 client_reg.Version = 0x0210; 216 client_reg.Version = 0x0210;
229 client_reg.event_callback_args.client_data = link; 217 client_reg.event_callback_args.client_data = link;
@@ -249,23 +237,14 @@ static dev_link_t *sedlbauer_attach(void)
249static void sedlbauer_detach(struct pcmcia_device *p_dev) 237static void sedlbauer_detach(struct pcmcia_device *p_dev)
250{ 238{
251 dev_link_t *link = dev_to_instance(p_dev); 239 dev_link_t *link = dev_to_instance(p_dev);
252 dev_link_t **linkp;
253 240
254 DEBUG(0, "sedlbauer_detach(0x%p)\n", link); 241 DEBUG(0, "sedlbauer_detach(0x%p)\n", link);
255
256 /* Locate device structure */
257 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
258 if (*linkp == link) break;
259 if (*linkp == NULL)
260 return;
261 242
262 if (link->state & DEV_CONFIG) { 243 if (link->state & DEV_CONFIG) {
263 ((local_info_t *)link->priv)->stop = 1; 244 ((local_info_t *)link->priv)->stop = 1;
264 sedlbauer_release(link); 245 sedlbauer_release(link);
265 } 246 }
266 247
267 /* Unlink device structure, and free it */
268 *linkp = link->next;
269 /* This points to the parent local_info_t struct */ 248 /* This points to the parent local_info_t struct */
270 kfree(link->priv); 249 kfree(link->priv);
271} /* sedlbauer_detach */ 250} /* sedlbauer_detach */
@@ -623,7 +602,6 @@ static int __init init_sedlbauer_cs(void)
623static void __exit exit_sedlbauer_cs(void) 602static void __exit exit_sedlbauer_cs(void)
624{ 603{
625 pcmcia_unregister_driver(&sedlbauer_driver); 604 pcmcia_unregister_driver(&sedlbauer_driver);
626 BUG_ON(dev_list != NULL);
627} 605}
628 606
629module_init(init_sedlbauer_cs); 607module_init(init_sedlbauer_cs);