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/serial | |
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/serial')
-rw-r--r-- | drivers/serial/serial_cs.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index a95366366504..6e7a1a0ae015 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -122,8 +122,6 @@ static dev_info_t dev_info = "serial_cs"; | |||
122 | static dev_link_t *serial_attach(void); | 122 | static dev_link_t *serial_attach(void); |
123 | static void serial_detach(struct pcmcia_device *p_dev); | 123 | static void serial_detach(struct pcmcia_device *p_dev); |
124 | 124 | ||
125 | static dev_link_t *dev_list = NULL; | ||
126 | |||
127 | /*====================================================================== | 125 | /*====================================================================== |
128 | 126 | ||
129 | After a card is removed, serial_remove() will unregister | 127 | After a card is removed, serial_remove() will unregister |
@@ -234,8 +232,7 @@ static dev_link_t *serial_attach(void) | |||
234 | link->conf.IntType = INT_MEMORY_AND_IO; | 232 | link->conf.IntType = INT_MEMORY_AND_IO; |
235 | 233 | ||
236 | /* Register with Card Services */ | 234 | /* Register with Card Services */ |
237 | link->next = dev_list; | 235 | link->next = NULL; /* not needed */ |
238 | dev_list = link; | ||
239 | client_reg.dev_info = &dev_info; | 236 | client_reg.dev_info = &dev_info; |
240 | client_reg.Version = 0x0210; | 237 | client_reg.Version = 0x0210; |
241 | client_reg.event_callback_args.client_data = link; | 238 | client_reg.event_callback_args.client_data = link; |
@@ -262,17 +259,9 @@ static void serial_detach(struct pcmcia_device *p_dev) | |||
262 | { | 259 | { |
263 | dev_link_t *link = dev_to_instance(p_dev); | 260 | dev_link_t *link = dev_to_instance(p_dev); |
264 | struct serial_info *info = link->priv; | 261 | struct serial_info *info = link->priv; |
265 | dev_link_t **linkp; | ||
266 | 262 | ||
267 | DEBUG(0, "serial_detach(0x%p)\n", link); | 263 | DEBUG(0, "serial_detach(0x%p)\n", link); |
268 | 264 | ||
269 | /* Locate device structure */ | ||
270 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
271 | if (*linkp == link) | ||
272 | break; | ||
273 | if (*linkp == NULL) | ||
274 | return; | ||
275 | |||
276 | /* | 265 | /* |
277 | * Ensure any outstanding scheduled tasks are completed. | 266 | * Ensure any outstanding scheduled tasks are completed. |
278 | */ | 267 | */ |
@@ -283,8 +272,7 @@ static void serial_detach(struct pcmcia_device *p_dev) | |||
283 | */ | 272 | */ |
284 | serial_remove(link); | 273 | serial_remove(link); |
285 | 274 | ||
286 | /* Unlink device structure, free bits */ | 275 | /* free bits */ |
287 | *linkp = link->next; | ||
288 | kfree(info); | 276 | kfree(info); |
289 | } | 277 | } |
290 | 278 | ||
@@ -871,7 +859,6 @@ static int __init init_serial_cs(void) | |||
871 | static void __exit exit_serial_cs(void) | 859 | static void __exit exit_serial_cs(void) |
872 | { | 860 | { |
873 | pcmcia_unregister_driver(&serial_cs_driver); | 861 | pcmcia_unregister_driver(&serial_cs_driver); |
874 | BUG_ON(dev_list != NULL); | ||
875 | } | 862 | } |
876 | 863 | ||
877 | module_init(init_serial_cs); | 864 | module_init(init_serial_cs); |