You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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:
@@ -122,8 +122,6 @@ static dev_info_t dev_info = "serial_cs";
|
||||
static dev_link_t *serial_attach(void);
|
||||
static void serial_detach(struct pcmcia_device *p_dev);
|
||||
|
||||
static dev_link_t *dev_list = NULL;
|
||||
|
||||
/*======================================================================
|
||||
|
||||
After a card is removed, serial_remove() will unregister
|
||||
@@ -234,8 +232,7 @@ static dev_link_t *serial_attach(void)
|
||||
link->conf.IntType = INT_MEMORY_AND_IO;
|
||||
|
||||
/* Register with Card Services */
|
||||
link->next = dev_list;
|
||||
dev_list = link;
|
||||
link->next = NULL; /* not needed */
|
||||
client_reg.dev_info = &dev_info;
|
||||
client_reg.Version = 0x0210;
|
||||
client_reg.event_callback_args.client_data = link;
|
||||
@@ -262,17 +259,9 @@ static void serial_detach(struct pcmcia_device *p_dev)
|
||||
{
|
||||
dev_link_t *link = dev_to_instance(p_dev);
|
||||
struct serial_info *info = link->priv;
|
||||
dev_link_t **linkp;
|
||||
|
||||
DEBUG(0, "serial_detach(0x%p)\n", link);
|
||||
|
||||
/* Locate device structure */
|
||||
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
|
||||
if (*linkp == link)
|
||||
break;
|
||||
if (*linkp == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Ensure any outstanding scheduled tasks are completed.
|
||||
*/
|
||||
@@ -283,8 +272,7 @@ static void serial_detach(struct pcmcia_device *p_dev)
|
||||
*/
|
||||
serial_remove(link);
|
||||
|
||||
/* Unlink device structure, free bits */
|
||||
*linkp = link->next;
|
||||
/* free bits */
|
||||
kfree(info);
|
||||
}
|
||||
|
||||
@@ -871,7 +859,6 @@ static int __init init_serial_cs(void)
|
||||
static void __exit exit_serial_cs(void)
|
||||
{
|
||||
pcmcia_unregister_driver(&serial_cs_driver);
|
||||
BUG_ON(dev_list != NULL);
|
||||
}
|
||||
|
||||
module_init(init_serial_cs);
|
||||
|
||||
Reference in New Issue
Block a user