[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>
This commit is contained in:
@ -97,8 +97,6 @@ static dev_info_t dev_info = "bt3c_cs";
|
||||
static dev_link_t *bt3c_attach(void);
|
||||
static void bt3c_detach(struct pcmcia_device *p_dev);
|
||||
|
||||
static dev_link_t *dev_list = NULL;
|
||||
|
||||
|
||||
/* Transmit states */
|
||||
#define XMIT_SENDING 1
|
||||
@ -691,8 +689,7 @@ static dev_link_t *bt3c_attach(void)
|
||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||
|
||||
/* Register with Card Services */
|
||||
link->next = dev_list;
|
||||
dev_list = link;
|
||||
link->next = NULL;
|
||||
client_reg.dev_info = &dev_info;
|
||||
client_reg.Version = 0x0210;
|
||||
client_reg.event_callback_args.client_data = link;
|
||||
@ -712,22 +709,10 @@ static void bt3c_detach(struct pcmcia_device *p_dev)
|
||||
{
|
||||
dev_link_t *link = dev_to_instance(p_dev);
|
||||
bt3c_info_t *info = link->priv;
|
||||
dev_link_t **linkp;
|
||||
|
||||
/* Locate device structure */
|
||||
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
|
||||
if (*linkp == link)
|
||||
break;
|
||||
|
||||
if (*linkp == NULL)
|
||||
return;
|
||||
|
||||
if (link->state & DEV_CONFIG)
|
||||
bt3c_release(link);
|
||||
|
||||
/* Unlink device structure, free bits */
|
||||
*linkp = link->next;
|
||||
|
||||
kfree(info);
|
||||
}
|
||||
|
||||
@ -949,7 +934,6 @@ static int __init init_bt3c_cs(void)
|
||||
static void __exit exit_bt3c_cs(void)
|
||||
{
|
||||
pcmcia_unregister_driver(&bt3c_driver);
|
||||
BUG_ON(dev_list != NULL);
|
||||
}
|
||||
|
||||
module_init(init_bt3c_cs);
|
||||
|
Reference in New Issue
Block a user