summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-03-21 05:14:11 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-03-21 05:14:11 +0000
commit705873982964a2d7c06131f5eed67c7f4d156f7f (patch)
tree757fdb1928bb0d36a3186e93038a16b8775327ff
parent9629b7e50e006f65c2c58dd847b6436017100005 (diff)
Add use counts to currently shipping stuff (bug #3773):
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@607 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwct4xxp.c5
-rwxr-xr-xwctdm.c6
-rwxr-xr-xwcte11xp.c4
3 files changed, 14 insertions, 1 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 94f6b0d..6606fc9 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -544,7 +544,10 @@ static int t4_open(struct zt_chan *chan)
{
#ifndef LINUX26
MOD_INC_USE_COUNT;
+#else
+ try_module_get(THIS_MODULE);
#endif
+
return 0;
}
@@ -552,6 +555,8 @@ static int t4_close(struct zt_chan *chan)
{
#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#else
+ module_put(THIS_MODULE);
#endif
return 0;
}
diff --git a/wctdm.c b/wctdm.c
index 4fcb757..c0de7cf 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -1722,7 +1722,9 @@ static int wctdm_open(struct zt_chan *chan)
wc->usecount++;
#ifndef LINUX26
MOD_INC_USE_COUNT;
-#endif
+#else
+ try_module_get(THIS_MODULE);
+#endif
return 0;
}
@@ -1740,6 +1742,8 @@ static int wctdm_close(struct zt_chan *chan)
wc->usecount--;
#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#else
+ module_put(THIS_MODULE);
#endif
for (x=0;x<wc->cards;x++)
wc->mod.fxs.idletxhookstate[x] = 1;
diff --git a/wcte11xp.c b/wcte11xp.c
index 7a0e4da..ccc6d3e 100755
--- a/wcte11xp.c
+++ b/wcte11xp.c
@@ -226,6 +226,8 @@ static int t1xxp_open(struct zt_chan *chan)
wc->usecount++;
#ifndef LINUX26
MOD_INC_USE_COUNT;
+#else
+ try_module_get(THIS_MODULE);
#endif
return 0;
}
@@ -346,6 +348,8 @@ static int t1xxp_close(struct zt_chan *chan)
wc->usecount--;
#ifndef LINUX26
MOD_DEC_USE_COUNT;
+#else
+ module_put(THIS_MODULE);
#endif
/* If we're dead, release us now */
if (!wc->usecount && wc->dead)