diff options
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 1828ba6ca25e..63221d383fda 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -91,7 +91,7 @@ static int btuart_event(event_t event, int priority, event_callback_args_t *args | |||
91 | static dev_info_t dev_info = "btuart_cs"; | 91 | static dev_info_t dev_info = "btuart_cs"; |
92 | 92 | ||
93 | static dev_link_t *btuart_attach(void); | 93 | static dev_link_t *btuart_attach(void); |
94 | static void btuart_detach(dev_link_t *); | 94 | static void btuart_detach(struct pcmcia_device *p_dev); |
95 | 95 | ||
96 | static dev_link_t *dev_list = NULL; | 96 | static dev_link_t *dev_list = NULL; |
97 | 97 | ||
@@ -619,7 +619,7 @@ static dev_link_t *btuart_attach(void) | |||
619 | ret = pcmcia_register_client(&link->handle, &client_reg); | 619 | ret = pcmcia_register_client(&link->handle, &client_reg); |
620 | if (ret != CS_SUCCESS) { | 620 | if (ret != CS_SUCCESS) { |
621 | cs_error(link->handle, RegisterClient, ret); | 621 | cs_error(link->handle, RegisterClient, ret); |
622 | btuart_detach(link); | 622 | btuart_detach(link->handle); |
623 | return NULL; | 623 | return NULL; |
624 | } | 624 | } |
625 | 625 | ||
@@ -627,11 +627,11 @@ static dev_link_t *btuart_attach(void) | |||
627 | } | 627 | } |
628 | 628 | ||
629 | 629 | ||
630 | static void btuart_detach(dev_link_t *link) | 630 | static void btuart_detach(struct pcmcia_device *p_dev) |
631 | { | 631 | { |
632 | dev_link_t *link = dev_to_instance(p_dev); | ||
632 | btuart_info_t *info = link->priv; | 633 | btuart_info_t *info = link->priv; |
633 | dev_link_t **linkp; | 634 | dev_link_t **linkp; |
634 | int ret; | ||
635 | 635 | ||
636 | /* Locate device structure */ | 636 | /* Locate device structure */ |
637 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | 637 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) |
@@ -644,12 +644,6 @@ static void btuart_detach(dev_link_t *link) | |||
644 | if (link->state & DEV_CONFIG) | 644 | if (link->state & DEV_CONFIG) |
645 | btuart_release(link); | 645 | btuart_release(link); |
646 | 646 | ||
647 | if (link->handle) { | ||
648 | ret = pcmcia_deregister_client(link->handle); | ||
649 | if (ret != CS_SUCCESS) | ||
650 | cs_error(link->handle, DeregisterClient, ret); | ||
651 | } | ||
652 | |||
653 | /* Unlink device structure, free bits */ | 647 | /* Unlink device structure, free bits */ |
654 | *linkp = link->next; | 648 | *linkp = link->next; |
655 | 649 | ||
@@ -837,16 +831,8 @@ static int btuart_resume(struct pcmcia_device *dev) | |||
837 | static int btuart_event(event_t event, int priority, event_callback_args_t *args) | 831 | static int btuart_event(event_t event, int priority, event_callback_args_t *args) |
838 | { | 832 | { |
839 | dev_link_t *link = args->client_data; | 833 | dev_link_t *link = args->client_data; |
840 | btuart_info_t *info = link->priv; | ||
841 | 834 | ||
842 | switch (event) { | 835 | switch (event) { |
843 | case CS_EVENT_CARD_REMOVAL: | ||
844 | link->state &= ~DEV_PRESENT; | ||
845 | if (link->state & DEV_CONFIG) { | ||
846 | btuart_close(info); | ||
847 | btuart_release(link); | ||
848 | } | ||
849 | break; | ||
850 | case CS_EVENT_CARD_INSERTION: | 836 | case CS_EVENT_CARD_INSERTION: |
851 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 837 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
852 | btuart_config(link); | 838 | btuart_config(link); |
@@ -869,7 +855,7 @@ static struct pcmcia_driver btuart_driver = { | |||
869 | }, | 855 | }, |
870 | .attach = btuart_attach, | 856 | .attach = btuart_attach, |
871 | .event = btuart_event, | 857 | .event = btuart_event, |
872 | .detach = btuart_detach, | 858 | .remove = btuart_detach, |
873 | .id_table = btuart_ids, | 859 | .id_table = btuart_ids, |
874 | .suspend = btuart_suspend, | 860 | .suspend = btuart_suspend, |
875 | .resume = btuart_resume, | 861 | .resume = btuart_resume, |