summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-rw-r--r--zaptel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/zaptel.c b/zaptel.c
index 1c484d9..c9e5b76 100644
--- a/zaptel.c
+++ b/zaptel.c
@@ -2401,10 +2401,19 @@ static int zt_open(struct inode *inode, struct file *file)
if (!zt_transcode_fops)
request_module("zttranscode");
if (zt_transcode_fops && zt_transcode_fops->open) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ if (zt_transcode_fops->owner) {
+ __MOD_INC_USE_COUNT (zt_transcode_fops->owner);
+#else
if (try_module_get(zt_transcode_fops->owner)) {
+#endif
ret = zt_transcode_fops->open(inode, file);
if (ret)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ __MOD_DEC_USE_COUNT (zt_transcode_fops->owner);
+#else
module_put(zt_transcode_fops->owner);
+#endif
}
return ret;
}
@@ -2734,7 +2743,12 @@ static int zt_release(struct inode *inode, struct file *file)
}
if (unit == 250) {
res = zt_transcode_fops->release(inode, file);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ if (zt_transcode_fops->owner)
+ __MOD_DEC_USE_COUNT (zt_transcode_fops->owner);
+#else
module_put(zt_transcode_fops->owner);
+#endif
return res;
}
if (unit == 254) {