aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c574_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/net/pcmcia/3c574_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/net/pcmcia/3c574_cs.c')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 60a3bc2b8fc4..8fcb63698ef1 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -255,8 +255,6 @@ static dev_info_t dev_info = "3c574_cs";
255static dev_link_t *tc574_attach(void); 255static dev_link_t *tc574_attach(void);
256static void tc574_detach(struct pcmcia_device *p_dev); 256static void tc574_detach(struct pcmcia_device *p_dev);
257 257
258static dev_link_t *dev_list;
259
260/* 258/*
261 tc574_attach() creates an "instance" of the driver, allocating 259 tc574_attach() creates an "instance" of the driver, allocating
262 local data structures for one device. The device is registered 260 local data structures for one device. The device is registered
@@ -308,8 +306,7 @@ static dev_link_t *tc574_attach(void)
308#endif 306#endif
309 307
310 /* Register with Card Services */ 308 /* Register with Card Services */
311 link->next = dev_list; 309 link->next = NULL;
312 dev_list = link;
313 client_reg.dev_info = &dev_info; 310 client_reg.dev_info = &dev_info;
314 client_reg.Version = 0x0210; 311 client_reg.Version = 0x0210;
315 client_reg.event_callback_args.client_data = link; 312 client_reg.event_callback_args.client_data = link;
@@ -336,24 +333,15 @@ static void tc574_detach(struct pcmcia_device *p_dev)
336{ 333{
337 dev_link_t *link = dev_to_instance(p_dev); 334 dev_link_t *link = dev_to_instance(p_dev);
338 struct net_device *dev = link->priv; 335 struct net_device *dev = link->priv;
339 dev_link_t **linkp;
340 336
341 DEBUG(0, "3c574_detach(0x%p)\n", link); 337 DEBUG(0, "3c574_detach(0x%p)\n", link);
342 338
343 /* Locate device structure */
344 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
345 if (*linkp == link) break;
346 if (*linkp == NULL)
347 return;
348
349 if (link->dev) 339 if (link->dev)
350 unregister_netdev(dev); 340 unregister_netdev(dev);
351 341
352 if (link->state & DEV_CONFIG) 342 if (link->state & DEV_CONFIG)
353 tc574_release(link); 343 tc574_release(link);
354 344
355 /* Unlink device structure, free bits */
356 *linkp = link->next;
357 free_netdev(dev); 345 free_netdev(dev);
358} /* tc574_detach */ 346} /* tc574_detach */
359 347
@@ -1310,7 +1298,6 @@ static int __init init_tc574(void)
1310static void __exit exit_tc574(void) 1298static void __exit exit_tc574(void)
1311{ 1299{
1312 pcmcia_unregister_driver(&tc574_driver); 1300 pcmcia_unregister_driver(&tc574_driver);
1313 BUG_ON(dev_list != NULL);
1314} 1301}
1315 1302
1316module_init(init_tc574); 1303module_init(init_tc574);