summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcb4xxp
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-06-29 20:56:07 +0000
committerShaun Ruffell <sruffell@digium.com>2009-06-29 20:56:07 +0000
commit6b34a37751245e4415323fbc3df4b11fd386d8b3 (patch)
tree00d903d8f17c3be33730d4e25b453306db83eca8 /drivers/dahdi/wcb4xxp
parent8429ae62a280f445e98c2857369dc1fc5a092685 (diff)
dahdi-base: Enable DAHDI to manage the reference counts for the board drivers.
Adds a struct module 'owner' member to the dahdi_span structure and updates all the board drivers to set this member before registering the span. This allows the core of dahdi to maintain the reference counts on the channels itself. (closes issue #10601) Reported by: Matti git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6794 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcb4xxp')
-rw-r--r--drivers/dahdi/wcb4xxp/base.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index f5db389..71e8255 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -2084,10 +2084,6 @@ static int b4xxp_open(struct dahdi_chan *chan)
struct b4xxp *b4 = chan->pvt;
struct b4xxp_span *bspan = &b4->spans[chan->span->offset];
- if (!try_module_get(THIS_MODULE)) {
- return -EBUSY;
- }
-
if (DBG_FOPS && DBG_SPANFILTER)
dev_info(b4->dev, "open() on chan %s (%i/%i)\n", chan->name, chan->channo, chan->chanpos);
@@ -2101,8 +2097,6 @@ static int b4xxp_close(struct dahdi_chan *chan)
struct b4xxp *b4 = chan->pvt;
struct b4xxp_span *bspan = &b4->spans[chan->span->offset];
- module_put(THIS_MODULE);
-
if (DBG_FOPS && DBG_SPANFILTER)
dev_info(b4->dev, "close() on chan %s (%i/%i)\n", chan->name, chan->channo, chan->chanpos);
@@ -2166,6 +2160,7 @@ static void init_spans(struct b4xxp *b4)
sprintf(bspan->span.location, "PCI Bus %02d Slot %02d",
b4->pdev->bus->number, PCI_SLOT(b4->pdev->devfn) + 1);
+ bspan->span.owner = THIS_MODULE;
bspan->span.spanconfig = b4xxp_spanconfig;
bspan->span.chanconfig = b4xxp_chanconfig;
bspan->span.startup = b4xxp_startup;