diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 15:23:14 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:03:10 -0500 |
commit | cc3b4866bee996c922e875b8c8efe9f0d8803aae (patch) | |
tree | 6632837b6986f33566f75ed971cecbdc210e3201 /drivers/net/wireless/wavelan_cs.c | |
parent | 8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (diff) |
[PATCH] pcmcia: unify detach, REMOVAL_EVENT handlers into one remove callback
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/wavelan_cs.c')
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 3e3532830c26..255952d8cea0 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -4692,7 +4692,7 @@ wavelan_attach(void) | |||
4692 | if(ret != 0) | 4692 | if(ret != 0) |
4693 | { | 4693 | { |
4694 | cs_error(link->handle, RegisterClient, ret); | 4694 | cs_error(link->handle, RegisterClient, ret); |
4695 | wavelan_detach(link); | 4695 | wavelan_detach(link->handle); |
4696 | return NULL; | 4696 | return NULL; |
4697 | } | 4697 | } |
4698 | 4698 | ||
@@ -4711,8 +4711,10 @@ wavelan_attach(void) | |||
4711 | * is released. | 4711 | * is released. |
4712 | */ | 4712 | */ |
4713 | static void | 4713 | static void |
4714 | wavelan_detach(dev_link_t * link) | 4714 | wavelan_detach(struct pcmcia_device *p_dev) |
4715 | { | 4715 | { |
4716 | dev_link_t *link = dev_to_instance(p_dev); | ||
4717 | |||
4716 | #ifdef DEBUG_CALLBACK_TRACE | 4718 | #ifdef DEBUG_CALLBACK_TRACE |
4717 | printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link); | 4719 | printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link); |
4718 | #endif | 4720 | #endif |
@@ -4729,10 +4731,6 @@ wavelan_detach(dev_link_t * link) | |||
4729 | wv_pcmcia_release(link); | 4731 | wv_pcmcia_release(link); |
4730 | } | 4732 | } |
4731 | 4733 | ||
4732 | /* Break the link with Card Services */ | ||
4733 | if(link->handle) | ||
4734 | pcmcia_deregister_client(link->handle); | ||
4735 | |||
4736 | /* Remove the interface data from the linked list */ | 4734 | /* Remove the interface data from the linked list */ |
4737 | if(dev_list == link) | 4735 | if(dev_list == link) |
4738 | dev_list = link->next; | 4736 | dev_list = link->next; |
@@ -4854,25 +4852,6 @@ wavelan_event(event_t event, /* The event received */ | |||
4854 | 4852 | ||
4855 | switch(event) | 4853 | switch(event) |
4856 | { | 4854 | { |
4857 | case CS_EVENT_REGISTRATION_COMPLETE: | ||
4858 | #ifdef DEBUG_CONFIG_INFO | ||
4859 | printk(KERN_DEBUG "wavelan_cs: registration complete\n"); | ||
4860 | #endif | ||
4861 | break; | ||
4862 | |||
4863 | case CS_EVENT_CARD_REMOVAL: | ||
4864 | /* Oups ! The card is no more there */ | ||
4865 | link->state &= ~DEV_PRESENT; | ||
4866 | if(link->state & DEV_CONFIG) | ||
4867 | { | ||
4868 | /* Accept no more transmissions */ | ||
4869 | netif_device_detach(dev); | ||
4870 | |||
4871 | /* Release the card */ | ||
4872 | wv_pcmcia_release(link); | ||
4873 | } | ||
4874 | break; | ||
4875 | |||
4876 | case CS_EVENT_CARD_INSERTION: | 4855 | case CS_EVENT_CARD_INSERTION: |
4877 | /* Reset and configure the card */ | 4856 | /* Reset and configure the card */ |
4878 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 4857 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
@@ -4906,7 +4885,7 @@ static struct pcmcia_driver wavelan_driver = { | |||
4906 | }, | 4885 | }, |
4907 | .attach = wavelan_attach, | 4886 | .attach = wavelan_attach, |
4908 | .event = wavelan_event, | 4887 | .event = wavelan_event, |
4909 | .detach = wavelan_detach, | 4888 | .remove = wavelan_detach, |
4910 | .id_table = wavelan_ids, | 4889 | .id_table = wavelan_ids, |
4911 | .suspend = wavelan_suspend, | 4890 | .suspend = wavelan_suspend, |
4912 | .resume = wavelan_resume, | 4891 | .resume = wavelan_resume, |