aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/sym53c500_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/sym53c500_cs.c')
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index c4e3e2294c66..a0f8e2691f9c 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -918,11 +918,6 @@ SYM53C500_event(event_t event, int priority, event_callback_args_t *args)
918 DEBUG(1, "SYM53C500_event(0x%06x)\n", event); 918 DEBUG(1, "SYM53C500_event(0x%06x)\n", event);
919 919
920 switch (event) { 920 switch (event) {
921 case CS_EVENT_CARD_REMOVAL:
922 link->state &= ~DEV_PRESENT;
923 if (link->state & DEV_CONFIG)
924 SYM53C500_release(link);
925 break;
926 case CS_EVENT_CARD_INSERTION: 921 case CS_EVENT_CARD_INSERTION:
927 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 922 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
928 SYM53C500_config(link); 923 SYM53C500_config(link);
@@ -932,8 +927,9 @@ SYM53C500_event(event_t event, int priority, event_callback_args_t *args)
932} /* SYM53C500_event */ 927} /* SYM53C500_event */
933 928
934static void 929static void
935SYM53C500_detach(dev_link_t *link) 930SYM53C500_detach(struct pcmcia_device *p_dev)
936{ 931{
932 dev_link_t *link = dev_to_instance(p_dev);
937 dev_link_t **linkp; 933 dev_link_t **linkp;
938 934
939 DEBUG(0, "SYM53C500_detach(0x%p)\n", link); 935 DEBUG(0, "SYM53C500_detach(0x%p)\n", link);
@@ -948,9 +944,6 @@ SYM53C500_detach(dev_link_t *link)
948 if (link->state & DEV_CONFIG) 944 if (link->state & DEV_CONFIG)
949 SYM53C500_release(link); 945 SYM53C500_release(link);
950 946
951 if (link->handle)
952 pcmcia_deregister_client(link->handle);
953
954 /* Unlink device structure, free bits. */ 947 /* Unlink device structure, free bits. */
955 *linkp = link->next; 948 *linkp = link->next;
956 kfree(link->priv); 949 kfree(link->priv);
@@ -993,7 +986,7 @@ SYM53C500_attach(void)
993 ret = pcmcia_register_client(&link->handle, &client_reg); 986 ret = pcmcia_register_client(&link->handle, &client_reg);
994 if (ret != 0) { 987 if (ret != 0) {
995 cs_error(link->handle, RegisterClient, ret); 988 cs_error(link->handle, RegisterClient, ret);
996 SYM53C500_detach(link); 989 SYM53C500_detach(link->handle);
997 return NULL; 990 return NULL;
998 } 991 }
999 992
@@ -1019,7 +1012,7 @@ static struct pcmcia_driver sym53c500_cs_driver = {
1019 }, 1012 },
1020 .attach = SYM53C500_attach, 1013 .attach = SYM53C500_attach,
1021 .event = SYM53C500_event, 1014 .event = SYM53C500_event,
1022 .detach = SYM53C500_detach, 1015 .remove = SYM53C500_detach,
1023 .id_table = sym53c500_ids, 1016 .id_table = sym53c500_ids,
1024 .suspend = sym53c500_suspend, 1017 .suspend = sym53c500_suspend,
1025 .resume = sym53c500_resume, 1018 .resume = sym53c500_resume,