diff options
Diffstat (limited to 'drivers/telephony/ixj_pcmcia.c')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index c58140dc7a73..6b992985d782 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -40,7 +40,6 @@ static void ixj_config(dev_link_t * link); | |||
40 | static void ixj_cs_release(dev_link_t * link); | 40 | static void ixj_cs_release(dev_link_t * link); |
41 | static int ixj_event(event_t event, int priority, event_callback_args_t * args); | 41 | static int ixj_event(event_t event, int priority, event_callback_args_t * args); |
42 | static dev_info_t dev_info = "ixj_cs"; | 42 | static dev_info_t dev_info = "ixj_cs"; |
43 | static dev_link_t *dev_list = NULL; | ||
44 | 43 | ||
45 | static dev_link_t *ixj_attach(void) | 44 | static dev_link_t *ixj_attach(void) |
46 | { | 45 | { |
@@ -65,8 +64,7 @@ static dev_link_t *ixj_attach(void) | |||
65 | } | 64 | } |
66 | memset(link->priv, 0, sizeof(struct ixj_info_t)); | 65 | memset(link->priv, 0, sizeof(struct ixj_info_t)); |
67 | /* Register with Card Services */ | 66 | /* Register with Card Services */ |
68 | link->next = dev_list; | 67 | link->next = NULL; |
69 | dev_list = link; | ||
70 | client_reg.dev_info = &dev_info; | 68 | client_reg.dev_info = &dev_info; |
71 | client_reg.Version = 0x0210; | 69 | client_reg.Version = 0x0210; |
72 | client_reg.event_callback_args.client_data = link; | 70 | client_reg.event_callback_args.client_data = link; |
@@ -82,20 +80,13 @@ static dev_link_t *ixj_attach(void) | |||
82 | static void ixj_detach(struct pcmcia_device *p_dev) | 80 | static void ixj_detach(struct pcmcia_device *p_dev) |
83 | { | 81 | { |
84 | dev_link_t *link = dev_to_instance(p_dev); | 82 | dev_link_t *link = dev_to_instance(p_dev); |
85 | dev_link_t **linkp; | ||
86 | 83 | ||
87 | DEBUG(0, "ixj_detach(0x%p)\n", link); | 84 | DEBUG(0, "ixj_detach(0x%p)\n", link); |
88 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | 85 | |
89 | if (*linkp == link) | ||
90 | break; | ||
91 | if (*linkp == NULL) | ||
92 | return; | ||
93 | link->state &= ~DEV_RELEASE_PENDING; | 86 | link->state &= ~DEV_RELEASE_PENDING; |
94 | if (link->state & DEV_CONFIG) | 87 | if (link->state & DEV_CONFIG) |
95 | ixj_cs_release(link); | 88 | ixj_cs_release(link); |
96 | 89 | ||
97 | /* Unlink device structure, free bits */ | ||
98 | *linkp = link->next; | ||
99 | kfree(link->priv); | 90 | kfree(link->priv); |
100 | kfree(link); | 91 | kfree(link); |
101 | } | 92 | } |
@@ -314,7 +305,6 @@ static int __init ixj_pcmcia_init(void) | |||
314 | static void ixj_pcmcia_exit(void) | 305 | static void ixj_pcmcia_exit(void) |
315 | { | 306 | { |
316 | pcmcia_unregister_driver(&ixj_driver); | 307 | pcmcia_unregister_driver(&ixj_driver); |
317 | BUG_ON(dev_list != NULL); | ||
318 | } | 308 | } |
319 | 309 | ||
320 | module_init(ixj_pcmcia_init); | 310 | module_init(ixj_pcmcia_init); |