aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
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/net/pcmcia
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/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c8
-rw-r--r--drivers/net/pcmcia/3c589_cs.c8
-rw-r--r--drivers/net/pcmcia/axnet_cs.c8
-rw-r--r--drivers/net/pcmcia/com20020_cs.c12
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c12
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c23
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c10
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c15
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c21
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c22
10 files changed, 38 insertions, 101 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index ce90becb8bdf..1799660bdc67 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -511,13 +511,7 @@ failed:
511 511
512static void tc574_release(dev_link_t *link) 512static void tc574_release(dev_link_t *link)
513{ 513{
514 DEBUG(0, "3c574_release(0x%p)\n", link); 514 pcmcia_disable_device(link->handle);
515
516 pcmcia_release_configuration(link->handle);
517 pcmcia_release_io(link->handle, &link->io);
518 pcmcia_release_irq(link->handle, &link->irq);
519
520 link->state &= ~DEV_CONFIG;
521} 515}
522 516
523static int tc574_suspend(struct pcmcia_device *p_dev) 517static int tc574_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 3dba50849da7..e36153851793 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -386,13 +386,7 @@ failed:
386 386
387static void tc589_release(dev_link_t *link) 387static void tc589_release(dev_link_t *link)
388{ 388{
389 DEBUG(0, "3c589_release(0x%p)\n", link); 389 pcmcia_disable_device(link->handle);
390
391 pcmcia_release_configuration(link->handle);
392 pcmcia_release_io(link->handle, &link->io);
393 pcmcia_release_irq(link->handle, &link->irq);
394
395 link->state &= ~DEV_CONFIG;
396} 390}
397 391
398static int tc589_suspend(struct pcmcia_device *p_dev) 392static int tc589_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 1cc94b2d76c1..9b9c0f19b21c 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -456,13 +456,7 @@ failed:
456 456
457static void axnet_release(dev_link_t *link) 457static void axnet_release(dev_link_t *link)
458{ 458{
459 DEBUG(0, "axnet_release(0x%p)\n", link); 459 pcmcia_disable_device(link->handle);
460
461 pcmcia_release_configuration(link->handle);
462 pcmcia_release_io(link->handle, &link->io);
463 pcmcia_release_irq(link->handle, &link->irq);
464
465 link->state &= ~DEV_CONFIG;
466} 460}
467 461
468static int axnet_suspend(struct pcmcia_device *p_dev) 462static int axnet_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 2827a48ea37c..a0ec5e7aacc6 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -377,16 +377,8 @@ failed:
377 377
378static void com20020_release(dev_link_t *link) 378static void com20020_release(dev_link_t *link)
379{ 379{
380 380 DEBUG(0, "com20020_release(0x%p)\n", link);
381 DEBUG(1,"release...\n"); 381 pcmcia_disable_device(link->handle);
382
383 DEBUG(0, "com20020_release(0x%p)\n", link);
384
385 pcmcia_release_configuration(link->handle);
386 pcmcia_release_io(link->handle, &link->io);
387 pcmcia_release_irq(link->handle, &link->irq);
388
389 link->state &= ~(DEV_CONFIG | DEV_RELEASE_PENDING);
390} 382}
391 383
392static int com20020_suspend(struct pcmcia_device *p_dev) 384static int com20020_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index b7ac14ba8877..6b435e940607 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -674,16 +674,8 @@ static int fmvj18x_setup_mfc(dev_link_t *link)
674 674
675static void fmvj18x_release(dev_link_t *link) 675static void fmvj18x_release(dev_link_t *link)
676{ 676{
677 677 DEBUG(0, "fmvj18x_release(0x%p)\n", link);
678 DEBUG(0, "fmvj18x_release(0x%p)\n", link); 678 pcmcia_disable_device(link->handle);
679
680 /* Don't bother checking to see if these succeed or not */
681 pcmcia_release_window(link->win);
682 pcmcia_release_configuration(link->handle);
683 pcmcia_release_io(link->handle, &link->io);
684 pcmcia_release_irq(link->handle, &link->irq);
685
686 link->state &= ~DEV_CONFIG;
687} 679}
688 680
689static int fmvj18x_suspend(struct pcmcia_device *p_dev) 681static int fmvj18x_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index b9c7e39576f5..1948a0bc198d 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -348,22 +348,17 @@ failed:
348 348
349static void ibmtr_release(dev_link_t *link) 349static void ibmtr_release(dev_link_t *link)
350{ 350{
351 ibmtr_dev_t *info = link->priv; 351 ibmtr_dev_t *info = link->priv;
352 struct net_device *dev = info->dev; 352 struct net_device *dev = info->dev;
353
354 DEBUG(0, "ibmtr_release(0x%p)\n", link);
355 353
356 pcmcia_release_configuration(link->handle); 354 DEBUG(0, "ibmtr_release(0x%p)\n", link);
357 pcmcia_release_io(link->handle, &link->io);
358 pcmcia_release_irq(link->handle, &link->irq);
359 if (link->win) {
360 struct tok_info *ti = netdev_priv(dev);
361 iounmap(ti->mmio);
362 pcmcia_release_window(link->win);
363 pcmcia_release_window(info->sram_win_handle);
364 }
365 355
366 link->state &= ~DEV_CONFIG; 356 if (link->win) {
357 struct tok_info *ti = netdev_priv(dev);
358 iounmap(ti->mmio);
359 pcmcia_release_window(info->sram_win_handle);
360 }
361 pcmcia_disable_device(link->handle);
367} 362}
368 363
369static int ibmtr_suspend(struct pcmcia_device *p_dev) 364static int ibmtr_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 787176c57fd9..76ef453d172d 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -765,14 +765,8 @@ nmclan_release
765---------------------------------------------------------------------------- */ 765---------------------------------------------------------------------------- */
766static void nmclan_release(dev_link_t *link) 766static void nmclan_release(dev_link_t *link)
767{ 767{
768 768 DEBUG(0, "nmclan_release(0x%p)\n", link);
769 DEBUG(0, "nmclan_release(0x%p)\n", link); 769 pcmcia_disable_device(link->handle);
770
771 pcmcia_release_configuration(link->handle);
772 pcmcia_release_io(link->handle, &link->io);
773 pcmcia_release_irq(link->handle, &link->irq);
774
775 link->state &= ~DEV_CONFIG;
776} 770}
777 771
778static int nmclan_suspend(struct pcmcia_device *p_dev) 772static int nmclan_suspend(struct pcmcia_device *p_dev)
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index b46e5f703efa..52f44bdff1f7 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -732,19 +732,14 @@ failed:
732 732
733static void pcnet_release(dev_link_t *link) 733static void pcnet_release(dev_link_t *link)
734{ 734{
735 pcnet_dev_t *info = PRIV(link->priv); 735 pcnet_dev_t *info = PRIV(link->priv);
736 736
737 DEBUG(0, "pcnet_release(0x%p)\n", link); 737 DEBUG(0, "pcnet_release(0x%p)\n", link);
738 738
739 if (info->flags & USE_SHMEM) { 739 if (info->flags & USE_SHMEM)
740 iounmap(info->base); 740 iounmap(info->base);
741 pcmcia_release_window(link->win);
742 }
743 pcmcia_release_configuration(link->handle);
744 pcmcia_release_io(link->handle, &link->io);
745 pcmcia_release_irq(link->handle, &link->irq);
746 741
747 link->state &= ~DEV_CONFIG; 742 pcmcia_disable_device(link->handle);
748} 743}
749 744
750/*====================================================================== 745/*======================================================================
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 8839c4faafd6..56700b154d44 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -1181,20 +1181,13 @@ config_failed: /* CS_EXIT_TEST() calls jump to here... */
1181 1181
1182static void smc91c92_release(dev_link_t *link) 1182static void smc91c92_release(dev_link_t *link)
1183{ 1183{
1184 1184 DEBUG(0, "smc91c92_release(0x%p)\n", link);
1185 DEBUG(0, "smc91c92_release(0x%p)\n", link); 1185 if (link->win) {
1186 1186 struct net_device *dev = link->priv;
1187 pcmcia_release_configuration(link->handle); 1187 struct smc_private *smc = netdev_priv(dev);
1188 pcmcia_release_io(link->handle, &link->io); 1188 iounmap(smc->base);
1189 pcmcia_release_irq(link->handle, &link->irq); 1189 }
1190 if (link->win) { 1190 pcmcia_disable_device(link->handle);
1191 struct net_device *dev = link->priv;
1192 struct smc_private *smc = netdev_priv(dev);
1193 iounmap(smc->base);
1194 pcmcia_release_window(link->win);
1195 }
1196
1197 link->state &= ~DEV_CONFIG;
1198} 1191}
1199 1192
1200/*====================================================================== 1193/*======================================================================
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index eed496803fe4..2b57a87371f3 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -1090,21 +1090,15 @@ xirc2ps_config(dev_link_t * link)
1090static void 1090static void
1091xirc2ps_release(dev_link_t *link) 1091xirc2ps_release(dev_link_t *link)
1092{ 1092{
1093 DEBUG(0, "release(0x%p)\n", link);
1093 1094
1094 DEBUG(0, "release(0x%p)\n", link); 1095 if (link->win) {
1095 1096 struct net_device *dev = link->priv;
1096 if (link->win) { 1097 local_info_t *local = netdev_priv(dev);
1097 struct net_device *dev = link->priv; 1098 if (local->dingo)
1098 local_info_t *local = netdev_priv(dev); 1099 iounmap(local->dingo_ccr - 0x0800);
1099 if (local->dingo) 1100 }
1100 iounmap(local->dingo_ccr - 0x0800); 1101 pcmcia_disable_device(link->handle);
1101 pcmcia_release_window(link->win);
1102 }
1103 pcmcia_release_configuration(link->handle);
1104 pcmcia_release_io(link->handle, &link->io);
1105 pcmcia_release_irq(link->handle, &link->irq);
1106 link->state &= ~DEV_CONFIG;
1107
1108} /* xirc2ps_release */ 1102} /* xirc2ps_release */
1109 1103
1110/*====================================================================*/ 1104/*====================================================================*/