aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/teles_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:23:14 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:03:10 -0500
commitcc3b4866bee996c922e875b8c8efe9f0d8803aae (patch)
tree6632837b6986f33566f75ed971cecbdc210e3201 /drivers/isdn/hisax/teles_cs.c
parent8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (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/isdn/hisax/teles_cs.c')
-rw-r--r--drivers/isdn/hisax/teles_cs.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 70213bc1d30c..cd0f86f0975b 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -87,7 +87,7 @@ static int teles_cs_event(event_t event, int priority,
87*/ 87*/
88 88
89static dev_link_t *teles_attach(void); 89static dev_link_t *teles_attach(void);
90static void teles_detach(dev_link_t *); 90static void teles_detach(struct pcmcia_device *p_dev);
91 91
92/* 92/*
93 The dev_info variable is the "key" that is used to match up this 93 The dev_info variable is the "key" that is used to match up this
@@ -197,7 +197,7 @@ static dev_link_t *teles_attach(void)
197 ret = pcmcia_register_client(&link->handle, &client_reg); 197 ret = pcmcia_register_client(&link->handle, &client_reg);
198 if (ret != CS_SUCCESS) { 198 if (ret != CS_SUCCESS) {
199 cs_error(link->handle, RegisterClient, ret); 199 cs_error(link->handle, RegisterClient, ret);
200 teles_detach(link); 200 teles_detach(link->handle);
201 return NULL; 201 return NULL;
202 } 202 }
203 203
@@ -213,11 +213,11 @@ static dev_link_t *teles_attach(void)
213 213
214======================================================================*/ 214======================================================================*/
215 215
216static void teles_detach(dev_link_t *link) 216static void teles_detach(struct pcmcia_device *p_dev)
217{ 217{
218 dev_link_t *link = dev_to_instance(p_dev);
218 dev_link_t **linkp; 219 dev_link_t **linkp;
219 local_info_t *info = link->priv; 220 local_info_t *info = link->priv;
220 int ret;
221 221
222 DEBUG(0, "teles_detach(0x%p)\n", link); 222 DEBUG(0, "teles_detach(0x%p)\n", link);
223 223
@@ -227,14 +227,9 @@ static void teles_detach(dev_link_t *link)
227 if (*linkp == NULL) 227 if (*linkp == NULL)
228 return; 228 return;
229 229
230 if (link->state & DEV_CONFIG) 230 if (link->state & DEV_CONFIG) {
231 info->busy = 1;
231 teles_cs_release(link); 232 teles_cs_release(link);
232
233 /* Break the link with Card Services */
234 if (link->handle) {
235 ret = pcmcia_deregister_client(link->handle);
236 if (ret != CS_SUCCESS)
237 cs_error(link->handle, DeregisterClient, ret);
238 } 233 }
239 234
240 /* Unlink device structure and free it */ 235 /* Unlink device structure and free it */
@@ -476,13 +471,6 @@ static int teles_cs_event(event_t event, int priority,
476 DEBUG(1, "teles_cs_event(%d)\n", event); 471 DEBUG(1, "teles_cs_event(%d)\n", event);
477 472
478 switch (event) { 473 switch (event) {
479 case CS_EVENT_CARD_REMOVAL:
480 link->state &= ~DEV_PRESENT;
481 if (link->state & DEV_CONFIG) {
482 ((local_info_t*)link->priv)->busy = 1;
483 teles_cs_release(link);
484 }
485 break;
486 case CS_EVENT_CARD_INSERTION: 474 case CS_EVENT_CARD_INSERTION:
487 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 475 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
488 teles_cs_config(link); 476 teles_cs_config(link);
@@ -504,7 +492,7 @@ static struct pcmcia_driver teles_cs_driver = {
504 }, 492 },
505 .attach = teles_attach, 493 .attach = teles_attach,
506 .event = teles_cs_event, 494 .event = teles_cs_event,
507 .detach = teles_detach, 495 .remove = teles_detach,
508 .id_table = teles_ids, 496 .id_table = teles_ids,
509 .suspend = teles_suspend, 497 .suspend = teles_suspend,
510 .resume = teles_resume, 498 .resume = teles_resume,