aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 21:25:35 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-06 00:03:20 +0100
commitb463581154f3f3eecda27cae60df813fefcd84d3 (patch)
tree5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/scsi
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/scsi')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c30
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c19
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c16
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c14
4 files changed, 11 insertions, 68 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 5842c938fff..538fedb9792 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -87,8 +87,6 @@ static dev_link_t *fdomain_attach(void);
static void fdomain_detach(struct pcmcia_device *p_dev);
-static dev_link_t *dev_list = NULL;
-
static dev_info_t dev_info = "fdomain_cs";
static dev_link_t *fdomain_attach(void)
@@ -116,8 +114,7 @@ static dev_link_t *fdomain_attach(void)
link->conf.Present = PRESENT_OPTION;
/* 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;
@@ -135,24 +132,14 @@ static dev_link_t *fdomain_attach(void)
static void fdomain_detach(struct pcmcia_device *p_dev)
{
- dev_link_t *link = dev_to_instance(p_dev);
- dev_link_t **linkp;
+ dev_link_t *link = dev_to_instance(p_dev);
- DEBUG(0, "fdomain_detach(0x%p)\n", link);
-
- /* Locate device structure */
- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
- if (*linkp == link) break;
- if (*linkp == NULL)
- return;
-
- if (link->state & DEV_CONFIG)
- fdomain_release(link);
-
- /* Unlink device structure, free bits */
- *linkp = link->next;
- kfree(link->priv);
-
+ DEBUG(0, "fdomain_detach(0x%p)\n", link);
+
+ if (link->state & DEV_CONFIG)
+ fdomain_release(link);
+
+ kfree(link->priv);
} /* fdomain_detach */
/*====================================================================*/
@@ -324,7 +311,6 @@ static int __init init_fdomain_cs(void)
static void __exit exit_fdomain_cs(void)
{
pcmcia_unregister_driver(&fdomain_cs_driver);
- BUG_ON(dev_list != NULL);
}
module_init(init_fdomain_cs);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index e40a8c22aa9..e48e9fb3c58 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 = {
#endif
};
-static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = {"nsp_cs"};
static nsp_hw_data nsp_data_base; /* attach <-> detect glue */
@@ -1638,8 +1637,7 @@ static dev_link_t *nsp_cs_attach(void)
/* 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;
@@ -1665,30 +1663,16 @@ static dev_link_t *nsp_cs_attach(void)
static void nsp_cs_detach(struct pcmcia_device *p_dev)
{
dev_link_t *link = dev_to_instance(p_dev);
- dev_link_t **linkp;
nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link);
- /* Locate device structure */
- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) {
- if (*linkp == link) {
- break;
- }
- }
- if (*linkp == NULL) {
- return;
- }
-
if (link->state & DEV_CONFIG) {
((scsi_info_t *)link->priv)->stop = 1;
nsp_cs_release(link);
}
- /* Unlink device structure, free bits */
- *linkp = link->next;
kfree(link->priv);
link->priv = NULL;
-
} /* nsp_cs_detach */
@@ -2168,7 +2152,6 @@ static void __exit nsp_cs_exit(void)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
pcmcia_unregister_driver(&nsp_driver);
- BUG_ON(dev_list != NULL);
#else
unregister_pcmcia_driver(&dev_info);
/* XXX: this really needs to move into generic code.. */
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 8351dc234ff..e10281a6e5f 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -104,8 +104,6 @@ static dev_link_t *qlogic_attach(void);
static void qlogic_detach(struct pcmcia_device *p_dev);
-static dev_link_t *dev_list = NULL;
-
static dev_info_t dev_info = "qlogic_cs";
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
@@ -190,8 +188,7 @@ static dev_link_t *qlogic_attach(void)
link->conf.Present = PRESENT_OPTION;
/* 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;
@@ -210,22 +207,12 @@ static dev_link_t *qlogic_attach(void)
static void qlogic_detach(struct pcmcia_device *p_dev)
{
dev_link_t *link = dev_to_instance(p_dev);
- dev_link_t **linkp;
DEBUG(0, "qlogic_detach(0x%p)\n", link);
- /* Locate device structure */
- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
- if (*linkp == link)
- break;
- if (*linkp == NULL)
- return;
-
if (link->state & DEV_CONFIG)
qlogic_release(link);
- /* Unlink device structure, free bits */
- *linkp = link->next;
kfree(link->priv);
} /* qlogic_detach */
@@ -439,7 +426,6 @@ static int __init init_qlogic_cs(void)
static void __exit exit_qlogic_cs(void)
{
pcmcia_unregister_driver(&qlogic_cs_driver);
- BUG_ON(dev_list != NULL);
}
MODULE_AUTHOR("Tom Zerucha, Michael Griffith");
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index a0f8e2691f9..87d50b33475 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -232,7 +232,6 @@ enum Phase {
* Global (within this module) variables other than
* sym53c500_driver_template (the scsi_host_template).
*/
-static dev_link_t *dev_list;
static dev_info_t dev_info = "sym53c500_cs";
/* ================================================================== */
@@ -930,22 +929,12 @@ static void
SYM53C500_detach(struct pcmcia_device *p_dev)
{
dev_link_t *link = dev_to_instance(p_dev);
- dev_link_t **linkp;
DEBUG(0, "SYM53C500_detach(0x%p)\n", link);
- /* Locate device structure */
- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
- if (*linkp == link)
- break;
- if (*linkp == NULL)
- return;
-
if (link->state & DEV_CONFIG)
SYM53C500_release(link);
- /* Unlink device structure, free bits. */
- *linkp = link->next;
kfree(link->priv);
link->priv = NULL;
} /* SYM53C500_detach */
@@ -978,8 +967,7 @@ SYM53C500_attach(void)
link->conf.Present = PRESENT_OPTION;
/* 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;