summaryrefslogtreecommitdiff
path: root/zaptel-base.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 04:25:21 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 04:25:21 +0000
commit74b471726593cf7f113774bbf7a00c9c7a274ad8 (patch)
treeb5998555216d2a8c205c6df2ee7e90ca5ebdad1d /zaptel-base.c
parentcf4a52b45376d07f0c0fc68eccdee45436d5192d (diff)
fix up some compiler warnings when building for 2.4 kernels
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2188 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel-base.c')
-rw-r--r--zaptel-base.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/zaptel-base.c b/zaptel-base.c
index 1391335..7108a9d 100644
--- a/zaptel-base.c
+++ b/zaptel-base.c
@@ -2340,26 +2340,30 @@ static void zt_free_pseudo(struct zt_chan *pseudo)
static int zt_open(struct inode *inode, struct file *file)
{
int unit = UNIT(file);
- int ret = -ENXIO;
struct zt_chan *chan;
+
/* Minor 0: Special "control" descriptor */
if (!unit)
return zt_ctl_open(inode, file);
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if (unit == 250) {
if (!zt_transcode_fops)
request_module("zttranscode");
if (zt_transcode_fops && zt_transcode_fops->open) {
if (try_module_get(zt_transcode_fops->owner)) {
+ int ret;
+
ret = zt_transcode_fops->open(inode, file);
if (ret)
module_put(zt_transcode_fops->owner);
+ return ret;
}
- return ret;
}
return -ENXIO;
}
#endif
+
if (unit == 253) {
if (maxspans) {
return zt_timing_open(inode, file);
@@ -6166,11 +6170,13 @@ zt_chan_poll(struct file *file, struct poll_table_struct *wait_table, int unit)
static int zt_mmap(struct file *file, struct vm_area_struct *vm)
{
- int unit = UNIT(file);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ int unit = UNIT(file);
+
if (unit == 250)
return zt_transcode_fops->mmap(file, vm);
#endif
+
return -ENOSYS;
}