aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-01-15 03:32:39 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:50 -0500
commit5f2a71fcb7995633b335a1e380ac63a968e61320 (patch)
treed47f4227d314fc9f298b75c217fa78440004e6e7 /drivers/isdn
parent1de9cedfbdff1d8adb662cd3afc5bda66e393351 (diff)
[PATCH] pcmcia: add pcmcia_disable_device
pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary cleanups upon device or driver removal: it calls the appropriate pcmcia_release_* functions, and can replace (most) of the current drivers' _release() functions. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c12
-rw-r--r--drivers/isdn/hisax/avma1_cs.c17
-rw-r--r--drivers/isdn/hisax/elsa_cs.c12
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c17
-rw-r--r--drivers/isdn/hisax/teles_cs.c12
5 files changed, 12 insertions, 58 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 2a2b03ff096b..f3889bdc8e43 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -367,16 +367,8 @@ found_port:
367 367
368static void avmcs_release(dev_link_t *link) 368static void avmcs_release(dev_link_t *link)
369{ 369{
370 b1pcmcia_delcard(link->io.BasePort1, link->irq.AssignedIRQ); 370 b1pcmcia_delcard(link->io.BasePort1, link->irq.AssignedIRQ);
371 371 pcmcia_disable_device(link->handle);
372 /* Unlink the device chain */
373 link->dev = NULL;
374
375 /* Don't bother checking to see if these succeed or not */
376 pcmcia_release_configuration(link->handle);
377 pcmcia_release_io(link->handle, &link->io);
378 pcmcia_release_irq(link->handle, &link->irq);
379 link->state &= ~DEV_CONFIG;
380} /* avmcs_release */ 372} /* avmcs_release */
381 373
382static int avmcs_suspend(struct pcmcia_device *dev) 374static int avmcs_suspend(struct pcmcia_device *dev)
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 969da40c4248..729c2de0bc1d 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -373,21 +373,14 @@ found_port:
373 373
374static void avma1cs_release(dev_link_t *link) 374static void avma1cs_release(dev_link_t *link)
375{ 375{
376 local_info_t *local = link->priv; 376 local_info_t *local = link->priv;
377 377
378 DEBUG(0, "avma1cs_release(0x%p)\n", link); 378 DEBUG(0, "avma1cs_release(0x%p)\n", link);
379 379
380 /* no unregister function with hisax */ 380 /* now unregister function with hisax */
381 HiSax_closecard(local->node.minor); 381 HiSax_closecard(local->node.minor);
382 382
383 /* Unlink the device chain */ 383 pcmcia_disable_device(link->handle);
384 link->dev = NULL;
385
386 /* Don't bother checking to see if these succeed or not */
387 pcmcia_release_configuration(link->handle);
388 pcmcia_release_io(link->handle, &link->io);
389 pcmcia_release_irq(link->handle, &link->irq);
390 link->state &= ~DEV_CONFIG;
391} /* avma1cs_release */ 384} /* avma1cs_release */
392 385
393static int avma1cs_suspend(struct pcmcia_device *dev) 386static int avma1cs_suspend(struct pcmcia_device *dev)
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 062fb8f0739f..60c75c7c016e 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -380,16 +380,8 @@ static void elsa_cs_release(dev_link_t *link)
380 HiSax_closecard(local->cardnr); 380 HiSax_closecard(local->cardnr);
381 } 381 }
382 } 382 }
383 /* Unlink the device chain */ 383
384 link->dev = NULL; 384 pcmcia_disable_device(link->handle);
385
386 /* Don't bother checking to see if these succeed or not */
387 if (link->win)
388 pcmcia_release_window(link->win);
389 pcmcia_release_configuration(link->handle);
390 pcmcia_release_io(link->handle, &link->io);
391 pcmcia_release_irq(link->handle, &link->irq);
392 link->state &= ~DEV_CONFIG;
393} /* elsa_cs_release */ 385} /* elsa_cs_release */
394 386
395static int elsa_suspend(struct pcmcia_device *p_dev) 387static int elsa_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 6f5213a18a8d..e59539157d19 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -467,23 +467,8 @@ static void sedlbauer_release(dev_link_t *link)
467 HiSax_closecard(local->cardnr); 467 HiSax_closecard(local->cardnr);
468 } 468 }
469 } 469 }
470 /* Unlink the device chain */
471 link->dev = NULL;
472 470
473 /* 471 pcmcia_disable_device(link->handle);
474 In a normal driver, additional code may be needed to release
475 other kernel data structures associated with this device.
476 */
477
478 /* Don't bother checking to see if these succeed or not */
479 if (link->win)
480 pcmcia_release_window(link->win);
481 pcmcia_release_configuration(link->handle);
482 if (link->io.NumPorts1)
483 pcmcia_release_io(link->handle, &link->io);
484 if (link->irq.AssignedIRQ)
485 pcmcia_release_irq(link->handle, &link->irq);
486 link->state &= ~DEV_CONFIG;
487} /* sedlbauer_release */ 472} /* sedlbauer_release */
488 473
489static int sedlbauer_suspend(struct pcmcia_device *p_dev) 474static int sedlbauer_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 4e5c14c7240e..7945fd64621a 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -371,16 +371,8 @@ static void teles_cs_release(dev_link_t *link)
371 HiSax_closecard(local->cardnr); 371 HiSax_closecard(local->cardnr);
372 } 372 }
373 } 373 }
374 /* Unlink the device chain */ 374
375 link->dev = NULL; 375 pcmcia_disable_device(link->handle);
376
377 /* Don't bother checking to see if these succeed or not */
378 if (link->win)
379 pcmcia_release_window(link->win);
380 pcmcia_release_configuration(link->handle);
381 pcmcia_release_io(link->handle, &link->io);
382 pcmcia_release_irq(link->handle, &link->irq);
383 link->state &= ~DEV_CONFIG;
384} /* teles_cs_release */ 376} /* teles_cs_release */
385 377
386static int teles_suspend(struct pcmcia_device *p_dev) 378static int teles_suspend(struct pcmcia_device *p_dev)