[zaptel-commits] tilghman: trunk r1247 - /trunk/zaptel.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Jul 26 14:57:11 MST 2006


Author: tilghman
Date: Wed Jul 26 16:57:10 2006
New Revision: 1247

URL: http://svn.digium.com/view/zaptel?rev=1247&view=rev
Log:
Allow zaptel to compile on 2.4 kernels

Modified:
    trunk/zaptel.c

Modified: trunk/zaptel.c
URL: http://svn.digium.com/view/zaptel/trunk/zaptel.c?rev=1247&r1=1246&r2=1247&view=diff
==============================================================================
--- trunk/zaptel.c (original)
+++ trunk/zaptel.c Wed Jul 26 16:57:10 2006
@@ -2401,10 +2401,19 @@
 		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 @@
 	}
 	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) {



More information about the zaptel-commits mailing list