diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 21:23:14 +0100 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-06 00:03:10 +0100 |
commit | cc3b4866bee996c922e875b8c8efe9f0d8803aae (patch) | |
tree | 6632837b6986f33566f75ed971cecbdc210e3201 /drivers/bluetooth/bluecard_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/bluetooth/bluecard_cs.c')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 5b24131e5430..f5088cb3812b 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c @@ -92,7 +92,7 @@ static int bluecard_event(event_t event, int priority, event_callback_args_t *ar static dev_info_t dev_info = "bluecard_cs"; static dev_link_t *bluecard_attach(void); -static void bluecard_detach(dev_link_t *); +static void bluecard_detach(struct pcmcia_device *p_dev); static dev_link_t *dev_list = NULL; @@ -899,7 +899,7 @@ static dev_link_t *bluecard_attach(void) ret = pcmcia_register_client(&link->handle, &client_reg); if (ret != CS_SUCCESS) { cs_error(link->handle, RegisterClient, ret); - bluecard_detach(link); + bluecard_detach(link->handle); return NULL; } @@ -907,11 +907,11 @@ static dev_link_t *bluecard_attach(void) } -static void bluecard_detach(dev_link_t *link) +static void bluecard_detach(struct pcmcia_device *p_dev) { + dev_link_t *link = dev_to_instance(p_dev); bluecard_info_t *info = link->priv; dev_link_t **linkp; - int ret; /* Locate device structure */ for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) @@ -924,12 +924,6 @@ static void bluecard_detach(dev_link_t *link) if (link->state & DEV_CONFIG) bluecard_release(link); - if (link->handle) { - ret = pcmcia_deregister_client(link->handle); - if (ret != CS_SUCCESS) - cs_error(link->handle, DeregisterClient, ret); - } - /* Unlink device structure, free bits */ *linkp = link->next; @@ -1070,16 +1064,8 @@ static int bluecard_resume(struct pcmcia_device *dev) static int bluecard_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; - bluecard_info_t *info = link->priv; switch (event) { - case CS_EVENT_CARD_REMOVAL: - link->state &= ~DEV_PRESENT; - if (link->state & DEV_CONFIG) { - bluecard_close(info); - bluecard_release(link); - } - break; case CS_EVENT_CARD_INSERTION: link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; bluecard_config(link); @@ -1104,7 +1090,7 @@ static struct pcmcia_driver bluecard_driver = { }, .attach = bluecard_attach, .event = bluecard_event, - .detach = bluecard_detach, + .remove = bluecard_detach, .id_table = bluecard_ids, .suspend = bluecard_suspend, .resume = bluecard_resume, |