aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/pcmcia/fdomain_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c30
1 files changed, 8 insertions, 22 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);