diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-06-26 17:07:39 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-06-26 17:07:39 +0000 |
commit | 889bfebfa6d46b65c1d15634b2f18589a311d41f (patch) | |
tree | ca233e587078c1abfe08422de25dbbcbdc6da2bd | |
parent | 275c1fc270a8e9c82d6e46ddf2a921b3c0fc16c9 (diff) |
wct4xxp: Unmap the same size DMA window that was mapped.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6768 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/wct4xxp/base.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 6558de8..d3dcdda 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -3807,6 +3807,7 @@ static void __devexit t4_remove_one(struct pci_dev *pdev) { struct t4 *wc = pci_get_drvdata(pdev); struct dahdi_span *span; + int basesize; int i; if (!wc) { @@ -3822,6 +3823,10 @@ static void __devexit t4_remove_one(struct pci_dev *pdev) wc->vpm450m = NULL; /* Unregister spans */ + basesize = DAHDI_MAX_CHUNKSIZE * 32 * 4; + if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN)) + basesize = basesize * 2; + for (i = 0; i < wc->numspans; ++i) { span = &wc->tspans[i]->span; if (test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags)) @@ -3842,7 +3847,9 @@ static void __devexit t4_remove_one(struct pci_dev *pdev) pci_release_regions(pdev); /* Immediately free resources */ - pci_free_consistent(pdev, DAHDI_MAX_CHUNKSIZE * 2 * 2 * 32 * 4, (void *)wc->writechunk, wc->writedma); + + pci_free_consistent(pdev, basesize * 2, + (void *)wc->writechunk, wc->writedma); order_index[wc->order]--; |