diff options
author | tilghman <tilghman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-26 21:57:10 +0000 |
---|---|---|
committer | tilghman <tilghman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-26 21:57:10 +0000 |
commit | 52f93befd32027ef712e0efd5f6f720f7886bc78 (patch) | |
tree | 432d0f99996038023166a832fccf17dc64c0ec0c /zaptel.c | |
parent | 4c1f7134300f26366e33052364a6d8d1e414bf71 (diff) |
Allow zaptel to compile on 2.4 kernels
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1247 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rw-r--r-- | zaptel.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) { |