aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/qlogic_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/qlogic_stub.c')
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 2541a999a0e5..8351dc234ffb 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -101,7 +101,7 @@ static void qlogic_release(dev_link_t *link);
101static int qlogic_event(event_t event, int priority, event_callback_args_t * args); 101static int qlogic_event(event_t event, int priority, event_callback_args_t * args);
102 102
103static dev_link_t *qlogic_attach(void); 103static dev_link_t *qlogic_attach(void);
104static void qlogic_detach(dev_link_t *); 104static void qlogic_detach(struct pcmcia_device *p_dev);
105 105
106 106
107static dev_link_t *dev_list = NULL; 107static dev_link_t *dev_list = NULL;
@@ -198,7 +198,7 @@ static dev_link_t *qlogic_attach(void)
198 ret = pcmcia_register_client(&link->handle, &client_reg); 198 ret = pcmcia_register_client(&link->handle, &client_reg);
199 if (ret != 0) { 199 if (ret != 0) {
200 cs_error(link->handle, RegisterClient, ret); 200 cs_error(link->handle, RegisterClient, ret);
201 qlogic_detach(link); 201 qlogic_detach(link->handle);
202 return NULL; 202 return NULL;
203 } 203 }
204 204
@@ -207,8 +207,9 @@ static dev_link_t *qlogic_attach(void)
207 207
208/*====================================================================*/ 208/*====================================================================*/
209 209
210static void qlogic_detach(dev_link_t * link) 210static void qlogic_detach(struct pcmcia_device *p_dev)
211{ 211{
212 dev_link_t *link = dev_to_instance(p_dev);
212 dev_link_t **linkp; 213 dev_link_t **linkp;
213 214
214 DEBUG(0, "qlogic_detach(0x%p)\n", link); 215 DEBUG(0, "qlogic_detach(0x%p)\n", link);
@@ -223,9 +224,6 @@ static void qlogic_detach(dev_link_t * link)
223 if (link->state & DEV_CONFIG) 224 if (link->state & DEV_CONFIG)
224 qlogic_release(link); 225 qlogic_release(link);
225 226
226 if (link->handle)
227 pcmcia_deregister_client(link->handle);
228
229 /* Unlink device structure, free bits */ 227 /* Unlink device structure, free bits */
230 *linkp = link->next; 228 *linkp = link->next;
231 kfree(link->priv); 229 kfree(link->priv);
@@ -390,11 +388,6 @@ static int qlogic_event(event_t event, int priority, event_callback_args_t * arg
390 DEBUG(1, "qlogic_event(0x%06x)\n", event); 388 DEBUG(1, "qlogic_event(0x%06x)\n", event);
391 389
392 switch (event) { 390 switch (event) {
393 case CS_EVENT_CARD_REMOVAL:
394 link->state &= ~DEV_PRESENT;
395 if (link->state & DEV_CONFIG)
396 qlogic_release(link);
397 break;
398 case CS_EVENT_CARD_INSERTION: 391 case CS_EVENT_CARD_INSERTION:
399 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 392 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
400 qlogic_config(link); 393 qlogic_config(link);
@@ -432,7 +425,7 @@ static struct pcmcia_driver qlogic_cs_driver = {
432 }, 425 },
433 .attach = qlogic_attach, 426 .attach = qlogic_attach,
434 .event = qlogic_event, 427 .event = qlogic_event,
435 .detach = qlogic_detach, 428 .remove = qlogic_detach,
436 .id_table = qlogic_ids, 429 .id_table = qlogic_ids,
437 .suspend = qlogic_suspend, 430 .suspend = qlogic_suspend,
438 .resume = qlogic_resume, 431 .resume = qlogic_resume,