diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 15:25:35 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:03:20 -0500 |
commit | b463581154f3f3eecda27cae60df813fefcd84d3 (patch) | |
tree | 5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/isdn/hisax/avma1_cs.c | |
parent | f3990715589d378a2d3aa9b8accd78bb4a2378b7 (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/avma1_cs.c')
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index 6b322e88c6c3..b6ea653f881e 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -99,15 +99,7 @@ static dev_info_t dev_info = "avma1_cs"; | |||
99 | device numbers are used to derive the corresponding array index. | 99 | device numbers are used to derive the corresponding array index. |
100 | */ | 100 | */ |
101 | 101 | ||
102 | static dev_link_t *dev_list = NULL; | ||
103 | |||
104 | /* | 102 | /* |
105 | A dev_link_t structure has fields for most things that are needed | ||
106 | to keep track of a socket, but there will usually be some device | ||
107 | specific information that also needs to be kept track of. The | ||
108 | 'priv' pointer in a dev_link_t structure can be used to point to | ||
109 | a device-specific private data structure, like this. | ||
110 | |||
111 | A driver needs to provide a dev_node_t structure for each device | 103 | A driver needs to provide a dev_node_t structure for each device |
112 | on a card. In some cases, there is only one device per card (for | 104 | on a card. In some cases, there is only one device per card (for |
113 | example, ethernet cards, modems). In other cases, there may be | 105 | example, ethernet cards, modems). In other cases, there may be |
@@ -179,8 +171,7 @@ static dev_link_t *avma1cs_attach(void) | |||
179 | link->conf.Present = PRESENT_OPTION; | 171 | link->conf.Present = PRESENT_OPTION; |
180 | 172 | ||
181 | /* Register with Card Services */ | 173 | /* Register with Card Services */ |
182 | link->next = dev_list; | 174 | link->next = NULL; |
183 | dev_list = link; | ||
184 | client_reg.dev_info = &dev_info; | 175 | client_reg.dev_info = &dev_info; |
185 | client_reg.Version = 0x0210; | 176 | client_reg.Version = 0x0210; |
186 | client_reg.event_callback_args.client_data = link; | 177 | client_reg.event_callback_args.client_data = link; |
@@ -206,21 +197,12 @@ static dev_link_t *avma1cs_attach(void) | |||
206 | static void avma1cs_detach(struct pcmcia_device *p_dev) | 197 | static void avma1cs_detach(struct pcmcia_device *p_dev) |
207 | { | 198 | { |
208 | dev_link_t *link = dev_to_instance(p_dev); | 199 | dev_link_t *link = dev_to_instance(p_dev); |
209 | dev_link_t **linkp; | ||
210 | 200 | ||
211 | DEBUG(0, "avma1cs_detach(0x%p)\n", link); | 201 | DEBUG(0, "avma1cs_detach(0x%p)\n", link); |
212 | 202 | ||
213 | /* Locate device structure */ | ||
214 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
215 | if (*linkp == link) break; | ||
216 | if (*linkp == NULL) | ||
217 | return; | ||
218 | |||
219 | if (link->state & DEV_CONFIG) | 203 | if (link->state & DEV_CONFIG) |
220 | avma1cs_release(link); | 204 | avma1cs_release(link); |
221 | 205 | ||
222 | /* Unlink device structure, free pieces */ | ||
223 | *linkp = link->next; | ||
224 | kfree(link->priv); | 206 | kfree(link->priv); |
225 | kfree(link); | 207 | kfree(link); |
226 | } /* avma1cs_detach */ | 208 | } /* avma1cs_detach */ |
@@ -508,7 +490,6 @@ static int __init init_avma1_cs(void) | |||
508 | static void __exit exit_avma1_cs(void) | 490 | static void __exit exit_avma1_cs(void) |
509 | { | 491 | { |
510 | pcmcia_unregister_driver(&avma1cs_driver); | 492 | pcmcia_unregister_driver(&avma1cs_driver); |
511 | BUG_ON(dev_list != NULL); | ||
512 | } | 493 | } |
513 | 494 | ||
514 | module_init(init_avma1_cs); | 495 | module_init(init_avma1_cs); |