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/net/wireless/atmel_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/net/wireless/atmel_cs.c')
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 3ab33dd49ea2..32f009709355 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -130,15 +130,7 @@ static dev_info_t dev_info = "atmel_cs"; | |||
130 | device numbers are used to derive the corresponding array index. | 130 | device numbers are used to derive the corresponding array index. |
131 | */ | 131 | */ |
132 | 132 | ||
133 | static dev_link_t *dev_list = NULL; | ||
134 | |||
135 | /* | 133 | /* |
136 | A dev_link_t structure has fields for most things that are needed | ||
137 | to keep track of a socket, but there will usually be some device | ||
138 | specific information that also needs to be kept track of. The | ||
139 | 'priv' pointer in a dev_link_t structure can be used to point to | ||
140 | a device-specific private data structure, like this. | ||
141 | |||
142 | A driver needs to provide a dev_node_t structure for each device | 134 | A driver needs to provide a dev_node_t structure for each device |
143 | on a card. In some cases, there is only one device per card (for | 135 | on a card. In some cases, there is only one device per card (for |
144 | example, ethernet cards, modems). In other cases, there may be | 136 | example, ethernet cards, modems). In other cases, there may be |
@@ -213,8 +205,7 @@ static dev_link_t *atmel_attach(void) | |||
213 | link->priv = local; | 205 | link->priv = local; |
214 | 206 | ||
215 | /* Register with Card Services */ | 207 | /* Register with Card Services */ |
216 | link->next = dev_list; | 208 | link->next = NULL; |
217 | dev_list = link; | ||
218 | client_reg.dev_info = &dev_info; | 209 | client_reg.dev_info = &dev_info; |
219 | client_reg.Version = 0x0210; | 210 | client_reg.Version = 0x0210; |
220 | client_reg.event_callback_args.client_data = link; | 211 | client_reg.event_callback_args.client_data = link; |
@@ -240,21 +231,12 @@ static dev_link_t *atmel_attach(void) | |||
240 | static void atmel_detach(struct pcmcia_device *p_dev) | 231 | static void atmel_detach(struct pcmcia_device *p_dev) |
241 | { | 232 | { |
242 | dev_link_t *link = dev_to_instance(p_dev); | 233 | dev_link_t *link = dev_to_instance(p_dev); |
243 | dev_link_t **linkp; | 234 | |
244 | |||
245 | DEBUG(0, "atmel_detach(0x%p)\n", link); | 235 | DEBUG(0, "atmel_detach(0x%p)\n", link); |
246 | |||
247 | /* Locate device structure */ | ||
248 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
249 | if (*linkp == link) break; | ||
250 | if (*linkp == NULL) | ||
251 | return; | ||
252 | 236 | ||
253 | if (link->state & DEV_CONFIG) | 237 | if (link->state & DEV_CONFIG) |
254 | atmel_release(link); | 238 | atmel_release(link); |
255 | 239 | ||
256 | /* Unlink device structure, free pieces */ | ||
257 | *linkp = link->next; | ||
258 | kfree(link->priv); | 240 | kfree(link->priv); |
259 | kfree(link); | 241 | kfree(link); |
260 | } | 242 | } |
@@ -596,7 +578,6 @@ static int atmel_cs_init(void) | |||
596 | static void atmel_cs_cleanup(void) | 578 | static void atmel_cs_cleanup(void) |
597 | { | 579 | { |
598 | pcmcia_unregister_driver(&atmel_driver); | 580 | pcmcia_unregister_driver(&atmel_driver); |
599 | BUG_ON(dev_list != NULL); | ||
600 | } | 581 | } |
601 | 582 | ||
602 | /* | 583 | /* |