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/scsi/pcmcia/nsp_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/scsi/pcmcia/nsp_cs.c')
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index e40a8c22aa9d..e48e9fb3c58c 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -104,7 +104,6 @@ static struct scsi_host_template nsp_driver_template = { | |||
104 | #endif | 104 | #endif |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static dev_link_t *dev_list = NULL; | ||
108 | static dev_info_t dev_info = {"nsp_cs"}; | 107 | static dev_info_t dev_info = {"nsp_cs"}; |
109 | 108 | ||
110 | static nsp_hw_data nsp_data_base; /* attach <-> detect glue */ | 109 | static nsp_hw_data nsp_data_base; /* attach <-> detect glue */ |
@@ -1638,8 +1637,7 @@ static dev_link_t *nsp_cs_attach(void) | |||
1638 | 1637 | ||
1639 | 1638 | ||
1640 | /* Register with Card Services */ | 1639 | /* Register with Card Services */ |
1641 | link->next = dev_list; | 1640 | link->next = NULL; |
1642 | dev_list = link; | ||
1643 | client_reg.dev_info = &dev_info; | 1641 | client_reg.dev_info = &dev_info; |
1644 | client_reg.Version = 0x0210; | 1642 | client_reg.Version = 0x0210; |
1645 | client_reg.event_callback_args.client_data = link; | 1643 | client_reg.event_callback_args.client_data = link; |
@@ -1665,30 +1663,16 @@ static dev_link_t *nsp_cs_attach(void) | |||
1665 | static void nsp_cs_detach(struct pcmcia_device *p_dev) | 1663 | static void nsp_cs_detach(struct pcmcia_device *p_dev) |
1666 | { | 1664 | { |
1667 | dev_link_t *link = dev_to_instance(p_dev); | 1665 | dev_link_t *link = dev_to_instance(p_dev); |
1668 | dev_link_t **linkp; | ||
1669 | 1666 | ||
1670 | nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); | 1667 | nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); |
1671 | 1668 | ||
1672 | /* Locate device structure */ | ||
1673 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) { | ||
1674 | if (*linkp == link) { | ||
1675 | break; | ||
1676 | } | ||
1677 | } | ||
1678 | if (*linkp == NULL) { | ||
1679 | return; | ||
1680 | } | ||
1681 | |||
1682 | if (link->state & DEV_CONFIG) { | 1669 | if (link->state & DEV_CONFIG) { |
1683 | ((scsi_info_t *)link->priv)->stop = 1; | 1670 | ((scsi_info_t *)link->priv)->stop = 1; |
1684 | nsp_cs_release(link); | 1671 | nsp_cs_release(link); |
1685 | } | 1672 | } |
1686 | 1673 | ||
1687 | /* Unlink device structure, free bits */ | ||
1688 | *linkp = link->next; | ||
1689 | kfree(link->priv); | 1674 | kfree(link->priv); |
1690 | link->priv = NULL; | 1675 | link->priv = NULL; |
1691 | |||
1692 | } /* nsp_cs_detach */ | 1676 | } /* nsp_cs_detach */ |
1693 | 1677 | ||
1694 | 1678 | ||
@@ -2168,7 +2152,6 @@ static void __exit nsp_cs_exit(void) | |||
2168 | 2152 | ||
2169 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) | 2153 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) |
2170 | pcmcia_unregister_driver(&nsp_driver); | 2154 | pcmcia_unregister_driver(&nsp_driver); |
2171 | BUG_ON(dev_list != NULL); | ||
2172 | #else | 2155 | #else |
2173 | unregister_pcmcia_driver(&dev_info); | 2156 | unregister_pcmcia_driver(&dev_info); |
2174 | /* XXX: this really needs to move into generic code.. */ | 2157 | /* XXX: this really needs to move into generic code.. */ |