aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/ibmtr_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/net/pcmcia/ibmtr_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/net/pcmcia/ibmtr_cs.c')
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 3a7218e51b73..961294983354 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -114,7 +114,7 @@ static int ibmtr_event(event_t event, int priority,
114static dev_info_t dev_info = "ibmtr_cs"; 114static dev_info_t dev_info = "ibmtr_cs";
115 115
116static dev_link_t *ibmtr_attach(void); 116static dev_link_t *ibmtr_attach(void);
117static void ibmtr_detach(dev_link_t *); 117static void ibmtr_detach(struct pcmcia_device *p_dev);
118 118
119static dev_link_t *dev_list; 119static dev_link_t *dev_list;
120 120
@@ -201,7 +201,7 @@ out:
201 return link; 201 return link;
202 202
203out_detach: 203out_detach:
204 ibmtr_detach(link); 204 ibmtr_detach(link->handle);
205 link = NULL; 205 link = NULL;
206 goto out; 206 goto out;
207} /* ibmtr_attach */ 207} /* ibmtr_attach */
@@ -215,8 +215,9 @@ out_detach:
215 215
216======================================================================*/ 216======================================================================*/
217 217
218static void ibmtr_detach(dev_link_t *link) 218static void ibmtr_detach(struct pcmcia_device *p_dev)
219{ 219{
220 dev_link_t *link = dev_to_instance(p_dev);
220 struct ibmtr_dev_t *info = link->priv; 221 struct ibmtr_dev_t *info = link->priv;
221 dev_link_t **linkp; 222 dev_link_t **linkp;
222 struct net_device *dev; 223 struct net_device *dev;
@@ -241,9 +242,6 @@ static void ibmtr_detach(dev_link_t *link)
241 if (link->state & DEV_CONFIG) 242 if (link->state & DEV_CONFIG)
242 ibmtr_release(link); 243 ibmtr_release(link);
243 244
244 if (link->handle)
245 pcmcia_deregister_client(link->handle);
246
247 /* Unlink device structure, free bits */ 245 /* Unlink device structure, free bits */
248 *linkp = link->next; 246 *linkp = link->next;
249 free_netdev(dev); 247 free_netdev(dev);
@@ -449,21 +447,10 @@ static int ibmtr_event(event_t event, int priority,
449 event_callback_args_t *args) 447 event_callback_args_t *args)
450{ 448{
451 dev_link_t *link = args->client_data; 449 dev_link_t *link = args->client_data;
452 ibmtr_dev_t *info = link->priv;
453 struct net_device *dev = info->dev;
454 450
455 DEBUG(1, "ibmtr_event(0x%06x)\n", event); 451 DEBUG(1, "ibmtr_event(0x%06x)\n", event);
456 452
457 switch (event) { 453 switch (event) {
458 case CS_EVENT_CARD_REMOVAL:
459 link->state &= ~DEV_PRESENT;
460 if (link->state & DEV_CONFIG) {
461 /* set flag to bypass normal interrupt code */
462 struct tok_info *priv = netdev_priv(dev);
463 priv->sram_phys |= 1;
464 netif_device_detach(dev);
465 }
466 break;
467 case CS_EVENT_CARD_INSERTION: 454 case CS_EVENT_CARD_INSERTION:
468 link->state |= DEV_PRESENT; 455 link->state |= DEV_PRESENT;
469 ibmtr_config(link); 456 ibmtr_config(link);
@@ -529,7 +516,7 @@ static struct pcmcia_driver ibmtr_cs_driver = {
529 }, 516 },
530 .attach = ibmtr_attach, 517 .attach = ibmtr_attach,
531 .event = ibmtr_event, 518 .event = ibmtr_event,
532 .detach = ibmtr_detach, 519 .remove = ibmtr_detach,
533 .id_table = ibmtr_ids, 520 .id_table = ibmtr_ids,
534 .suspend = ibmtr_suspend, 521 .suspend = ibmtr_suspend,
535 .resume = ibmtr_resume, 522 .resume = ibmtr_resume,