summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/hostap/hostap_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 21:23:14 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-06 00:03:10 +0100
commitcc3b4866bee996c922e875b8c8efe9f0d8803aae (patch)
tree6632837b6986f33566f75ed971cecbdc210e3201 /drivers/net/wireless/hostap/hostap_cs.c
parent8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (diff)
downloadlwn-cc3b4866bee996c922e875b8c8efe9f0d8803aae.tar.gz
lwn-cc3b4866bee996c922e875b8c8efe9f0d8803aae.zip
[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/hostap/hostap_cs.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index ba4a7da98ccd..866142af7d92 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -203,7 +203,7 @@ static int hfa384x_to_bap(struct net_device *dev, u16 bap, void *buf, int len)
-static void prism2_detach(dev_link_t *link);
+static void prism2_detach(struct pcmcia_device *p_dev);
static void prism2_release(u_long arg);
static int prism2_event(event_t event, int priority,
event_callback_args_t *args);
@@ -528,15 +528,16 @@ static dev_link_t *prism2_attach(void)
ret = pcmcia_register_client(&link->handle, &client_reg);
if (ret != CS_SUCCESS) {
cs_error(link->handle, RegisterClient, ret);
- prism2_detach(link);
+ prism2_detach(link->handle);
return NULL;
}
return link;
}
-static void prism2_detach(dev_link_t *link)
+static void prism2_detach(struct pcmcia_device *p_dev)
{
+ dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
PDEBUG(DEBUG_FLOW, "prism2_detach\n");
@@ -554,14 +555,6 @@ static void prism2_detach(dev_link_t *link)
prism2_release((u_long)link);
}
- if (link->handle) {
- int res = pcmcia_deregister_client(link->handle);
- if (res) {
- printk("CardService(DeregisterClient) => %d\n", res);
- cs_error(link->handle, DeregisterClient, res);
- }
- }
-
*linkp = link->next;
/* release net devices */
if (link->priv) {
@@ -902,7 +895,6 @@ static int prism2_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
- struct net_device *dev = (struct net_device *) link->priv;
switch (event) {
case CS_EVENT_CARD_INSERTION:
@@ -913,16 +905,6 @@ static int prism2_event(event_t event, int priority,
}
break;
- case CS_EVENT_CARD_REMOVAL:
- PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_REMOVAL\n", dev_info);
- link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG) {
- netif_stop_queue(dev);
- netif_device_detach(dev);
- prism2_release((u_long) link);
- }
- break;
-
default:
PDEBUG(DEBUG_EXTRA, "%s: prism2_event() - unknown event %d\n",
dev_info, event);
@@ -991,7 +973,7 @@ static struct pcmcia_driver hostap_driver = {
.name = "hostap_cs",
},
.attach = prism2_attach,
- .detach = prism2_detach,
+ .remove = prism2_detach,
.owner = THIS_MODULE,
.event = prism2_event,
.id_table = hostap_cs_ids,