summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi_dynamic.c
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/dahdi_dynamic.c
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/dahdi_dynamic.c')
-rw-r--r--drivers/dahdi/dahdi_dynamic.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c
index 2a5c267..e83fb80 100644
--- a/drivers/dahdi/dahdi_dynamic.c
+++ b/drivers/dahdi/dahdi_dynamic.c
@@ -516,8 +516,6 @@ static int ztd_open(struct dahdi_chan *chan)
return -ENODEV;
z->usecount++;
}
- if(!try_module_get(THIS_MODULE))
- printk(KERN_NOTICE "TDMoX: Unable to increment module use count\n");
return 0;
}
@@ -534,7 +532,6 @@ static int ztd_close(struct dahdi_chan *chan)
z->usecount--;
if (z->dead && !z->usecount)
dynamic_destroy(z);
- module_put(THIS_MODULE);
return 0;
}
@@ -604,6 +601,7 @@ static int create_dynamic(struct dahdi_dynamic_span *zds)
z->timing = zds->timing;
sprintf(z->span.name, "DYN/%s/%s", zds->driver, zds->addr);
sprintf(z->span.desc, "Dynamic '%s' span at '%s'", zds->driver, zds->addr);
+ z->span.owner = THIS_MODULE;
z->span.channels = zds->numchans;
z->span.pvt = z;
z->span.deflaw = DAHDI_LAW_MULAW;