diff options
Diffstat (limited to 'drivers/scsi/pcmcia/nsp_cs.c')
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 870e87180d12..e40a8c22aa9d 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1646,7 +1646,7 @@ static dev_link_t *nsp_cs_attach(void) | |||
1646 | ret = pcmcia_register_client(&link->handle, &client_reg); | 1646 | ret = pcmcia_register_client(&link->handle, &client_reg); |
1647 | if (ret != CS_SUCCESS) { | 1647 | if (ret != CS_SUCCESS) { |
1648 | cs_error(link->handle, RegisterClient, ret); | 1648 | cs_error(link->handle, RegisterClient, ret); |
1649 | nsp_cs_detach(link); | 1649 | nsp_cs_detach(link->handle); |
1650 | return NULL; | 1650 | return NULL; |
1651 | } | 1651 | } |
1652 | 1652 | ||
@@ -1662,8 +1662,9 @@ static dev_link_t *nsp_cs_attach(void) | |||
1662 | structures are freed. Otherwise, the structures will be freed | 1662 | structures are freed. Otherwise, the structures will be freed |
1663 | when the device is released. | 1663 | when the device is released. |
1664 | ======================================================================*/ | 1664 | ======================================================================*/ |
1665 | static void nsp_cs_detach(dev_link_t *link) | 1665 | static void nsp_cs_detach(struct pcmcia_device *p_dev) |
1666 | { | 1666 | { |
1667 | dev_link_t *link = dev_to_instance(p_dev); | ||
1667 | dev_link_t **linkp; | 1668 | dev_link_t **linkp; |
1668 | 1669 | ||
1669 | nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); | 1670 | nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); |
@@ -1678,12 +1679,9 @@ static void nsp_cs_detach(dev_link_t *link) | |||
1678 | return; | 1679 | return; |
1679 | } | 1680 | } |
1680 | 1681 | ||
1681 | if (link->state & DEV_CONFIG) | 1682 | if (link->state & DEV_CONFIG) { |
1683 | ((scsi_info_t *)link->priv)->stop = 1; | ||
1682 | nsp_cs_release(link); | 1684 | nsp_cs_release(link); |
1683 | |||
1684 | /* Break the link with Card Services */ | ||
1685 | if (link->handle) { | ||
1686 | pcmcia_deregister_client(link->handle); | ||
1687 | } | 1685 | } |
1688 | 1686 | ||
1689 | /* Unlink device structure, free bits */ | 1687 | /* Unlink device structure, free bits */ |
@@ -2096,15 +2094,6 @@ static int nsp_cs_event(event_t event, | |||
2096 | nsp_dbg(NSP_DEBUG_INIT, "in, event=0x%08x", event); | 2094 | nsp_dbg(NSP_DEBUG_INIT, "in, event=0x%08x", event); |
2097 | 2095 | ||
2098 | switch (event) { | 2096 | switch (event) { |
2099 | case CS_EVENT_CARD_REMOVAL: | ||
2100 | nsp_dbg(NSP_DEBUG_INIT, "event: remove"); | ||
2101 | link->state &= ~DEV_PRESENT; | ||
2102 | if (link->state & DEV_CONFIG) { | ||
2103 | ((scsi_info_t *)link->priv)->stop = 1; | ||
2104 | nsp_cs_release(link); | ||
2105 | } | ||
2106 | break; | ||
2107 | |||
2108 | case CS_EVENT_CARD_INSERTION: | 2097 | case CS_EVENT_CARD_INSERTION: |
2109 | nsp_dbg(NSP_DEBUG_INIT, "event: insert"); | 2098 | nsp_dbg(NSP_DEBUG_INIT, "event: insert"); |
2110 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 2099 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
@@ -2144,7 +2133,7 @@ static struct pcmcia_driver nsp_driver = { | |||
2144 | }, | 2133 | }, |
2145 | .attach = nsp_cs_attach, | 2134 | .attach = nsp_cs_attach, |
2146 | .event = nsp_cs_event, | 2135 | .event = nsp_cs_event, |
2147 | .detach = nsp_cs_detach, | 2136 | .remove = nsp_cs_detach, |
2148 | .id_table = nsp_cs_ids, | 2137 | .id_table = nsp_cs_ids, |
2149 | .suspend = nsp_cs_suspend, | 2138 | .suspend = nsp_cs_suspend, |
2150 | .resume = nsp_cs_resume, | 2139 | .resume = nsp_cs_resume, |